summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--util/src/entities/Member.ts2
-rw-r--r--util/src/entities/Message.ts2
2 files changed, 2 insertions, 2 deletions
diff --git a/util/src/entities/Member.ts b/util/src/entities/Member.ts
index 387181df..8529398b 100644
--- a/util/src/entities/Member.ts
+++ b/util/src/entities/Member.ts
@@ -74,7 +74,7 @@ export class Member extends BaseClassWithoutId {
 	nick?: string;
 
 	setNick(val: string) {
-		if (BannedWords.find(val)) throw FieldErrors({ nick: { message: "Bad nickname", code: "INVALID_NICKNAME" } });
+		if (val && BannedWords.find(val)) throw FieldErrors({ nick: { message: "Bad nickname", code: "INVALID_NICKNAME" } });
 		this.nick = val;
 	}
 
diff --git a/util/src/entities/Message.ts b/util/src/entities/Message.ts
index 78888e17..6ea5c4aa 100644
--- a/util/src/entities/Message.ts
+++ b/util/src/entities/Message.ts
@@ -117,7 +117,7 @@ export class Message extends BaseClass {
 	content?: string;
 
 	setContent(val: string) {
-		if (BannedWords.find(val)) throw new HTTPError("Message was blocked by automatic moderation", 200000);
+		if (val && BannedWords.find(val)) throw new HTTPError("Message was blocked by automatic moderation", 200000);
 		this.content = val;
 	}