1
0
mirror of https://github.com/matrix-org/matrix-react-sdk.git synced 2025-12-20 20:42:03 +03:00

Add typeof check for body

This commit is contained in:
Florian Duros
2022-10-26 19:16:29 +02:00
parent c0282e0351
commit 39f1dc224c

View File

@@ -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());