fix: missing null check in hideEdit condition

This commit is contained in:
Jayesh Nirve 2021-08-27 21:11:06 +05:30
parent 56817df437
commit 4af6763765
No known key found for this signature in database
GPG Key ID: E9F26B1FCEB549BD
1 changed files with 3 additions and 1 deletions

View File

@ -589,7 +589,9 @@ class Event extends MatrixEvent {
RegExp(r'^>( \*)? <[^>]+>[^\n\r]+\r?\n(> [^\n]*\r?\n)*\r?\n'), ''); RegExp(r'^>( \*)? <[^>]+>[^\n\r]+\r?\n(> [^\n]*\r?\n)*\r?\n'), '');
} }
// Hide edit fallback // Hide edit fallback
if (hideEdit && relationshipType == RelationshipTypes.edit) { if (hideEdit &&
relationshipType == RelationshipTypes.edit &&
content.containsKey('m.new_content')) {
localizedBody = content['m.new_content']['body'] ?? localizedBody; localizedBody = content['m.new_content']['body'] ?? localizedBody;
} }