From d251af4e6dcb7862802268a04fa508a4ab58b234 Mon Sep 17 00:00:00 2001 From: Will Hunt Date: Mon, 4 Nov 2024 12:12:37 +0000 Subject: [PATCH] Make event listener more resillient. --- src/useReactions.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/useReactions.tsx b/src/useReactions.tsx index 499d5d0f..d38fca01 100644 --- a/src/useReactions.tsx +++ b/src/useReactions.tsx @@ -197,10 +197,9 @@ export const ReactionsProvider = ({ } if (event.getType() === ElementCallReactionEventType) { - // TODO: Validate content. const content: ECallReactionEventContent = event.getContent(); - const membershipEventId = content["m.relates_to"].event_id; + const membershipEventId = content?.["m.relates_to"]?.event_id; // Check to see if this reaction was made to a membership event (and the // sender of the reaction matches the membership) if (