diff --git a/src/models/actions/create/CreateUser.ts b/src/models/actions/create/CreateUser.ts index adc43e7..a29fb62 100644 --- a/src/models/actions/create/CreateUser.ts +++ b/src/models/actions/create/CreateUser.ts @@ -95,7 +95,7 @@ export class CreateUser { if (!this.email) { throw new UserEmailNeededError(); } - if (this.username.includes("@")) { throw new UsernameContainsIllegalCharacterError(); } + if (this.username?.includes("@")) { throw new UsernameContainsIllegalCharacterError(); } let password_strength = passwordStrength(this.password); if (!password_strength.contains.includes("uppercase")) { throw new PasswordMustContainUppercaseLetterError(); }