From 96f44b873e0a0a117cd6c72b7a6b368bdd22f67e Mon Sep 17 00:00:00 2001 From: Dragory <2606411+Dragory@users.noreply.github.com> Date: Thu, 16 Apr 2020 00:03:07 +0300 Subject: [PATCH] Fix rare automod crash when the member for a message can't be found This edge case should only occur when the member is banned or otherwise leaves the server before automod processes the message. --- backend/src/plugins/Automod/Automod.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/backend/src/plugins/Automod/Automod.ts b/backend/src/plugins/Automod/Automod.ts index eebf0e1a..d80144b2 100644 --- a/backend/src/plugins/Automod/Automod.ts +++ b/backend/src/plugins/Automod/Automod.ts @@ -596,6 +596,7 @@ export class AutomodPlugin extends ZeppelinPlugin>> { const messageInfo: MessageInfo = { channelId: msg.channel_id, messageId: msg.id, userId: msg.user_id }; const member = await this.getMember(msg.user_id); + if (!member) return; if (trigger.match_messages && msg.data.content) { const str = msg.data.content;