Skip to content

Commit

Permalink
Display fallback when replied event content is partially missing
Browse files Browse the repository at this point in the history
  • Loading branch information
aringenbach committed Jul 4, 2022
1 parent 67249ac commit 6a63546
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1867,6 +1867,13 @@ - (NSString*)buildHTMLStringForEvent:(MXEvent*)event inReplyToEvent:(MXEvent*)re
MXJSONModelSetString(repliedEventContent, repliedEvent.content[kMXMessageBodyKey]);
}
}

// No message content in a non-redacted event. Formatter should use fallback.
if (!repliedEventContent)
{
MXLogWarning(@"[MXKEventFormatter] Unable to retrieve content from replied event %@", repliedEvent.description)
return nil;
}
}

if (event.content[kMXMessageContentKeyNewContent])
Expand Down Expand Up @@ -1899,7 +1906,7 @@ - (NSString*)buildHTMLStringForEvent:(MXEvent*)event inReplyToEvent:(MXEvent*)re
}
else
{
MXLogDebug(@"[MXKEventFormatter] Unable to build reply event %@", event.description)
MXLogWarning(@"[MXKEventFormatter] Unable to build reply event %@", event.description)
}

return html;
Expand Down
1 change: 1 addition & 0 deletions changelog.d/6371.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Display fallback when replied event content is partially missing

0 comments on commit 6a63546

Please sign in to comment.