Skip to content

Commit

Permalink
Check formattedText.length instead of nullability
Browse files Browse the repository at this point in the history
  • Loading branch information
aringenbach committed Jul 18, 2022
1 parent f248acc commit 12f9bbb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions MatrixSDK/Aggregations/MXAggregatedEditsUpdater.m
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ - (MXHTTPOperation*)replaceTextMessageEvent:(MXEvent*)event

// This enables editing replies that don't provide a fallback mx-reply body.
compatibilityText = [NSString stringWithFormat:@"* %@", text];
if (formattedText)
if (formattedText.length > 0)
{
compatibilityFormattedText = [NSString stringWithFormat:@"* %@", formattedText];
}
Expand All @@ -112,7 +112,7 @@ - (MXHTTPOperation*)replaceTextMessageEvent:(MXEvent*)event
else
{
compatibilityText = [NSString stringWithFormat:@"* %@", text];
if (formattedText)
if (formattedText.length > 0)
{
compatibilityFormattedText = [NSString stringWithFormat:@"* %@", formattedText];
}
Expand All @@ -134,7 +134,7 @@ - (MXHTTPOperation*)replaceTextMessageEvent:(MXEvent*)event

NSMutableDictionary *newContent = [NSMutableDictionary dictionaryWithDictionary:@{ kMXMessageTypeKey: messageType,
kMXMessageBodyKey: text }];
if (formattedText)
if (formattedText.length > 0)
{
[newContent addEntriesFromDictionary:@{
@"formatted_body": formattedText,
Expand Down

0 comments on commit 12f9bbb

Please sign in to comment.