From 0a160218a66a880043bfb74403e7cc25357f521b Mon Sep 17 00:00:00 2001 From: Usoka <27248545+Usoka@users.noreply.github.com> Date: Tue, 25 May 2021 20:37:15 +1200 Subject: [PATCH] Prevent crash when using !!emoji with no args --- backend/src/plugins/Utility/commands/EmojiInfoCmd.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/src/plugins/Utility/commands/EmojiInfoCmd.ts b/backend/src/plugins/Utility/commands/EmojiInfoCmd.ts index 41889509..4c771946 100644 --- a/backend/src/plugins/Utility/commands/EmojiInfoCmd.ts +++ b/backend/src/plugins/Utility/commands/EmojiInfoCmd.ts @@ -15,7 +15,7 @@ export const EmojiInfoCmd = utilityCmd({ }, async run({ message, args, pluginData }) { - const emojiIdMatch = args.emoji.match(customEmojiRegex); + const emojiIdMatch = args.emoji?.match(customEmojiRegex); if (!emojiIdMatch?.[2]) { sendErrorMessage(pluginData, message.channel, "Emoji not found"); return;