From a343d9999e1cddbde72ce6570517783e507dcd47 Mon Sep 17 00:00:00 2001 From: ginnyTheCat Date: Sun, 11 Sep 2022 15:21:05 +0200 Subject: [PATCH] Handle messages with invalid body (#833) --- src/app/molecules/message/Message.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/molecules/message/Message.jsx b/src/app/molecules/message/Message.jsx index 7d3ee63..ab05e0e 100644 --- a/src/app/molecules/message/Message.jsx +++ b/src/app/molecules/message/Message.jsx @@ -737,7 +737,6 @@ function Message({ replyTo(senderId, mEvent.getId(), body); }, [body]); - if (body === undefined) return null; if (msgType === 'm.emote') className.push('message--type-emote'); let isCustomHTML = content.format === 'org.matrix.custom.html'; @@ -752,13 +751,14 @@ function Message({ const editedList = editedTimeline.get(eventId); const editedMEvent = editedList[editedList.length - 1]; [body, isCustomHTML, customHTML] = getEditedBody(editedMEvent); - if (typeof body !== 'string') return null; } if (isReply) { body = parseReply(body)?.body ?? body; } + if (typeof body !== 'string') body = ''; + return (
{