From 070bc961868f1005ccabd14dc40d3db39c9e9b58 Mon Sep 17 00:00:00 2001 From: RMidhunSuresh Date: Tue, 11 May 2021 13:43:54 +0530 Subject: [PATCH] Fallback to empty string if content is undefined Signed-off-by: RMidhunSuresh --- src/domain/session/room/timeline/tiles/TextTile.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/domain/session/room/timeline/tiles/TextTile.js b/src/domain/session/room/timeline/tiles/TextTile.js index 1f940970..5a1bdb78 100644 --- a/src/domain/session/room/timeline/tiles/TextTile.js +++ b/src/domain/session/room/timeline/tiles/TextTile.js @@ -20,7 +20,7 @@ import { MessageBodyBuilder } from "../MessageBodyBuilder.js"; export class TextTile extends MessageTile { get messageFormat() { const content = this._getContent(); - let body = content && content.body; + let body = content?.body || ""; if (content.msgtype === "m.emote") { body = `* ${this.displayName} ${body}`; }