Handle messages with invalid body (#833)
This commit is contained in:
parent
0a2cca6e40
commit
a343d9999e
1 changed files with 2 additions and 2 deletions
|
@ -737,7 +737,6 @@ function Message({
|
||||||
replyTo(senderId, mEvent.getId(), body);
|
replyTo(senderId, mEvent.getId(), body);
|
||||||
}, [body]);
|
}, [body]);
|
||||||
|
|
||||||
if (body === undefined) return null;
|
|
||||||
if (msgType === 'm.emote') className.push('message--type-emote');
|
if (msgType === 'm.emote') className.push('message--type-emote');
|
||||||
|
|
||||||
let isCustomHTML = content.format === 'org.matrix.custom.html';
|
let isCustomHTML = content.format === 'org.matrix.custom.html';
|
||||||
|
@ -752,13 +751,14 @@ function Message({
|
||||||
const editedList = editedTimeline.get(eventId);
|
const editedList = editedTimeline.get(eventId);
|
||||||
const editedMEvent = editedList[editedList.length - 1];
|
const editedMEvent = editedList[editedList.length - 1];
|
||||||
[body, isCustomHTML, customHTML] = getEditedBody(editedMEvent);
|
[body, isCustomHTML, customHTML] = getEditedBody(editedMEvent);
|
||||||
if (typeof body !== 'string') return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isReply) {
|
if (isReply) {
|
||||||
body = parseReply(body)?.body ?? body;
|
body = parseReply(body)?.body ?? body;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (typeof body !== 'string') body = '';
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={className.join(' ')}>
|
<div className={className.join(' ')}>
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue