From de15b3a9a4803d070df06b3cf040830000fb85ec Mon Sep 17 00:00:00 2001 From: Madeline <46743919+MaddyUnderStars@users.noreply.github.com> Date: Mon, 12 Sep 2022 00:17:54 +1000 Subject: Allow empty content through block list --- util/src/entities/Member.ts | 2 +- util/src/entities/Message.ts | 2 +- 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; } -- cgit 1.4.1