From e3c9dbf85130a64c40fb025d23988723f844851e Mon Sep 17 00:00:00 2001 From: Dragory <2606411+Dragory@users.noreply.github.com> Date: Wed, 18 Aug 2021 22:29:46 +0300 Subject: [PATCH] Hotfix 6 --- backend/src/plugins/Automod/triggers/matchAttachmentType.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/backend/src/plugins/Automod/triggers/matchAttachmentType.ts b/backend/src/plugins/Automod/triggers/matchAttachmentType.ts index ba8e4e59..4ae2b65e 100644 --- a/backend/src/plugins/Automod/triggers/matchAttachmentType.ts +++ b/backend/src/plugins/Automod/triggers/matchAttachmentType.ts @@ -32,6 +32,12 @@ export const MatchAttachmentTypeTrigger = automodTrigger()({ const attachments: any[] = context.message.data.attachments; for (const attachment of attachments) { + // FIXME: Hotfix + if (!attachment.filename) { + console.warn("No attachment filename:", attachment); + continue; + } + const attachmentType = attachment.filename .split(".") .pop()