fix: null assertion has a chance of throwing error here

This commit is contained in:
Paul Makles 2022-09-17 10:50:26 +01:00
parent 71e689ece3
commit b42c24295f

View file

@ -117,7 +117,11 @@ const Message = observer(
} }
contrast={contrast} contrast={contrast}
sending={typeof queued !== "undefined"} 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"} failed={typeof queued?.error !== "undefined"}
{...(attachContext {...(attachContext
? useTriggerEvents("Menu", { ? useTriggerEvents("Menu", {