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,
MarkedUnread(unread).toJson(),
);
if (unread == false) {
await sendReadMarker(lastEvent.eventId,
readReceiptLocationEventId: lastEvent.eventId);
if (unread == false && lastEvent != null) {
await sendReadMarker(
lastEvent.eventId,
readReceiptLocationEventId: lastEvent.eventId,
);
}
}