mirror of https://github.com/vector-im/riot-web
Add typeof check for body
parent
c0282e0351
commit
39f1dc224c
|
@ -60,7 +60,7 @@ function getHtmlReplyFallback(mxEvent: MatrixEvent): string {
|
||||||
|
|
||||||
function getTextReplyFallback(mxEvent: MatrixEvent): string {
|
function getTextReplyFallback(mxEvent: MatrixEvent): string {
|
||||||
const body = mxEvent.getContent().body;
|
const body = mxEvent.getContent().body;
|
||||||
if (!body) {
|
if (!body || typeof body !== 'string') {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
const lines = body.split("\n").map(l => l.trim());
|
const lines = body.split("\n").map(l => l.trim());
|
||||||
|
|
Loading…
Reference in New Issue