isHtml makes no sense if there is no formatted_body

this is a bug pre-replies but replies exacerbates it

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
Michael Telatynski 2018-03-05 07:33:18 +00:00
parent df56a67fda
commit 3b02766be9
No known key found for this signature in database
GPG Key ID: 3F879DA5AD802A5E

View File

@ -414,7 +414,7 @@ class TextHighlighter extends BaseHighlighter {
* opts.stripReplyFallback: optional argument specifying the event is a reply and so fallback needs removing * opts.stripReplyFallback: optional argument specifying the event is a reply and so fallback needs removing
*/ */
export function bodyToHtml(content, highlights, opts={}) { export function bodyToHtml(content, highlights, opts={}) {
const isHtml = (content.format === "org.matrix.custom.html"); const isHtml = (content.format === "org.matrix.custom.html") && content.formatted_body;
let body; let body;
if (isHtml) { if (isHtml) {
body = content.formatted_body; body = content.formatted_body;