fix: Missing null check

This commit is contained in:
Christian Pauly 2020-12-29 09:44:13 +01:00
parent 71fb80aa1f
commit 19905e348a
1 changed files with 5 additions and 3 deletions

View File

@ -445,9 +445,11 @@ class Room {
EventType.MarkedUnread, EventType.MarkedUnread,
MarkedUnread(unread).toJson(), MarkedUnread(unread).toJson(),
); );
if (unread == false) { if (unread == false && lastEvent != null) {
await sendReadMarker(lastEvent.eventId, await sendReadMarker(
readReceiptLocationEventId: lastEvent.eventId); lastEvent.eventId,
readReceiptLocationEventId: lastEvent.eventId,
);
} }
} }