diff --git a/Riot/Modules/MatrixKit/Utils/EventFormatter/MXKEventFormatter.m b/Riot/Modules/MatrixKit/Utils/EventFormatter/MXKEventFormatter.m index 1aa344af6..77a8a0d39 100644 --- a/Riot/Modules/MatrixKit/Utils/EventFormatter/MXKEventFormatter.m +++ b/Riot/Modules/MatrixKit/Utils/EventFormatter/MXKEventFormatter.m @@ -1854,6 +1854,13 @@ static NSString *const kHTMLATagRegexPattern = @"( 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]) @@ -1886,7 +1893,7 @@ static NSString *const kHTMLATagRegexPattern = @"( } else { - MXLogDebug(@"[MXKEventFormatter] Unable to build reply event %@", event.description) + MXLogWarning(@"[MXKEventFormatter] Unable to build reply event %@", event.description) } return html; diff --git a/changelog.d/6371.bugfix b/changelog.d/6371.bugfix new file mode 100644 index 000000000..7829efb59 --- /dev/null +++ b/changelog.d/6371.bugfix @@ -0,0 +1 @@ +Display fallback when replied event content is partially missing