From 39f1dc224c18e99ed0e0c0190ba8d67a068d2a6c Mon Sep 17 00:00:00 2001 From: Florian Duros Date: Wed, 26 Oct 2022 19:16:29 +0200 Subject: [PATCH] Add typeof check for body --- src/components/views/rooms/EditMessageComposer.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/views/rooms/EditMessageComposer.tsx b/src/components/views/rooms/EditMessageComposer.tsx index e75168d413..a9f756d1c2 100644 --- a/src/components/views/rooms/EditMessageComposer.tsx +++ b/src/components/views/rooms/EditMessageComposer.tsx @@ -60,7 +60,7 @@ function getHtmlReplyFallback(mxEvent: MatrixEvent): string { function getTextReplyFallback(mxEvent: MatrixEvent): string { const body = mxEvent.getContent().body; - if (!body) { + if (!body || typeof body !== 'string') { return ""; } const lines = body.split("\n").map(l => l.trim());