From b42c24295f9ff8ffa87f252c38c115b3384b983f Mon Sep 17 00:00:00 2001 From: Paul Makles Date: Sat, 17 Sep 2022 10:50:26 +0100 Subject: [PATCH] fix: null assertion has a chance of throwing error here --- src/components/common/messaging/Message.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/common/messaging/Message.tsx b/src/components/common/messaging/Message.tsx index a30550d1..693feadb 100644 --- a/src/components/common/messaging/Message.tsx +++ b/src/components/common/messaging/Message.tsx @@ -117,7 +117,11 @@ const Message = observer( } contrast={contrast} sending={typeof queued !== "undefined"} - mention={message.mention_ids?.includes(client.user!._id)} + mention={ + message.mention_ids && client.user + ? message.mention_ids.includes(client.user._id) + : undefined + } failed={typeof queued?.error !== "undefined"} {...(attachContext ? useTriggerEvents("Menu", {