From 87eccaf69a9609eca8dbf0ac543a97e4f982c8d6 Mon Sep 17 00:00:00 2001 From: Kevin Wang Date: Sat, 17 Dec 2022 10:24:08 -0500 Subject: [PATCH] fix: error thrown when no emotes are rendered (#845) --- lib/models/messages/twitch/subscription_message_event.dart | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/models/messages/twitch/subscription_message_event.dart b/lib/models/messages/twitch/subscription_message_event.dart index b2e775c27..0b2c10934 100644 --- a/lib/models/messages/twitch/subscription_message_event.dart +++ b/lib/models/messages/twitch/subscription_message_event.dart @@ -46,6 +46,9 @@ class TwitchSubscriptionMessageEventModel extends MessageModel { : super(messageId: messageId, timestamp: timestamp); String emotesToString() { + if (emotes.isEmpty) { + return ""; + } return emotes .map((e) => '${e.id}:${e.begin}-${e.end}') .reduce((value, element) => '$value/$element');