fix: prev content error log in web

This commit is contained in:
Christian Pauly 2020-09-07 11:16:52 +02:00
parent e6d96ad8ed
commit 8a0cc70cfe

View file

@ -105,8 +105,10 @@ class Event extends MatrixEvent {
try {
this.prevContent = (prevContent != null && prevContent.isNotEmpty)
? prevContent
: (this.unsigned != null && this.unsigned['prev_content'] is Map)
? this.unsigned['prev_content']
: (unsigned != null &&
unsigned.containsKey('prev_content') &&
unsigned['prev_content'] is Map)
? unsigned['prev_content']
: null;
} catch (e, s) {
Logs.error('Event constructor crashed: ${e.toString()}', s);