fix null check

This commit is contained in:
Jayesh Nirve 2021-08-17 05:09:34 +05:30 committed by td
parent 38235415eb
commit 572402980c
1 changed files with 3 additions and 3 deletions

View File

@ -857,9 +857,9 @@ class FamedlySdkHiveDatabase extends DatabaseApi {
);
final Map states = await _roomStateBox
.get(MultiKey(eventUpdate.roomID, EventTypes.Message).toString());
final eventsInRoomStateBox = states.values
.map((raw) => Event.fromJson(convertToJson(raw), room))
.toList();
final eventsInRoomStateBox = states?.values
?.map((raw) => Event.fromJson(convertToJson(raw), room))
?.toList();
for (final event in eventsInRoomStateBox) {
if (event.type == 'm.room.message') {