From 8a0cc70cfec2fa03baab4c7abf4e4f4d1be88dc6 Mon Sep 17 00:00:00 2001 From: Christian Pauly Date: Mon, 7 Sep 2020 11:16:52 +0200 Subject: [PATCH] fix: prev content error log in web --- lib/src/event.dart | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/src/event.dart b/lib/src/event.dart index 0299acd..3c183e5 100644 --- a/lib/src/event.dart +++ b/lib/src/event.dart @@ -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);