diff --git a/lib/src/Event.dart b/lib/src/Event.dart index 51ed072..5067afb 100644 --- a/lib/src/Event.dart +++ b/lib/src/Event.dart @@ -130,12 +130,11 @@ class Event { static Event fromJson(Map jsonObj, Room room) { Map content = jsonObj["content"]; - if (content == null) + if (content == null && jsonObj["content_json"] != null) try { content = json.decode(jsonObj["content_json"]); } catch (e) { - print( - "jsonObj decode of event content '$jsonObj' failed: ${e.toString()}"); + print("jsonObj decode of event content failed: ${e.toString()}"); content = {}; } diff --git a/lib/src/Store.dart b/lib/src/Store.dart index bd42542..7e6b9c6 100644 --- a/lib/src/Store.dart +++ b/lib/src/Store.dart @@ -474,10 +474,8 @@ class Store { List eventList = []; - for (num i = 0; i < eventRes.length; i++) { - print("Try to parse Event $i of ${eventRes.length}: ${eventRes[i]}"); + for (num i = 0; i < eventRes.length; i++) eventList.add(Event.fromJson(eventRes[i], room)); - } return eventList; }