Add typeof check for body

This commit is contained in:
Florian Duros 2022-10-26 19:16:29 +02:00
parent c0282e0351
commit 39f1dc224c
No known key found for this signature in database
GPG key ID: 9700AA5870258A0B

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