From c0282e0351ea18d591dae0f5de4d1a57f33799f4 Mon Sep 17 00:00:00 2001 From: Florian Duros Date: Wed, 26 Oct 2022 19:09:12 +0200 Subject: [PATCH] Add check for body --- src/components/views/rooms/EditMessageComposer.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/components/views/rooms/EditMessageComposer.tsx b/src/components/views/rooms/EditMessageComposer.tsx index 52312e1a99..e75168d413 100644 --- a/src/components/views/rooms/EditMessageComposer.tsx +++ b/src/components/views/rooms/EditMessageComposer.tsx @@ -60,6 +60,9 @@ function getHtmlReplyFallback(mxEvent: MatrixEvent): string { function getTextReplyFallback(mxEvent: MatrixEvent): string { const body = mxEvent.getContent().body; + if (!body) { + return ""; + } const lines = body.split("\n").map(l => l.trim()); if (lines.length > 2 && lines[0].startsWith("> ") && lines[1].length === 0) { return `${lines[0]}\n\n`;