Fixed some stuff not getting checked against null

ref #39 gosh i sometimes hate js types
This commit is contained in:
2020-12-20 18:18:32 +01:00
parent fbe2b358bd
commit 7a4238f1f7
10 changed files with 15 additions and 19 deletions

View File

@@ -88,7 +88,7 @@ export class UpdateUser {
public async updateUser(user: User): Promise<User> {
user.email = this.email;
user.username = this.username;
if (user.email === undefined && user.username === undefined) {
if ((user.email === undefined || user.email === null) && (user.username === undefined || user.username === null)) {
throw new UsernameOrEmailNeededError();
}
if (this.password) {