From 992246817062cfcf7f07a0b830fab5e46636c97c Mon Sep 17 00:00:00 2001 From: Daniel Fischer Date: Tue, 25 Feb 2020 16:52:44 +0100 Subject: [PATCH] UserNotice#parseEmotes: bail early if there's no message text --- .../TwitchCommandsCapability/MessageTypes/UserNotice.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/twitch-chat-client/src/Capabilities/TwitchCommandsCapability/MessageTypes/UserNotice.ts b/packages/twitch-chat-client/src/Capabilities/TwitchCommandsCapability/MessageTypes/UserNotice.ts index a4ad4af69..b41ab39ef 100644 --- a/packages/twitch-chat-client/src/Capabilities/TwitchCommandsCapability/MessageTypes/UserNotice.ts +++ b/packages/twitch-chat-client/src/Capabilities/TwitchCommandsCapability/MessageTypes/UserNotice.ts @@ -35,6 +35,11 @@ export default class UserNotice extends Message { parseEmotes() { const messageText = this.params.message; + + if (!messageText) { + return []; + } + const foundEmotes: ParsedMessagePart[] = parseEmotePositions(messageText, this.emoteOffsets); return fillTextPositions(messageText, foundEmotes);