diff --git a/src/useReactions.tsx b/src/useReactions.tsx index d38fca01..f068ca3a 100644 --- a/src/useReactions.tsx +++ b/src/useReactions.tsx @@ -213,10 +213,17 @@ export const ReactionsProvider = ({ return; } + const emoji = content.emoji?.split(/(?:)/u)?.[0]; + + if (!emoji) { + logger.warn(`Reaction had no emoji from ${reactionEventId}`); + return; + } + // One of our custom reactions const reaction = { ...GenericReaction, - emoji: content.emoji, + emoji, // If we don't find a reaction, we can fallback to the generic sound. ...ReactionSet.find((r) => r.name === content.name), };