Merge branch 'krille/nullcheck' into 'main'

fix: Missing null check

See merge request famedly/famedlysdk!591
This commit is contained in:
Sorunome 2020-12-29 09:15:21 +00:00
commit 0a64ed2c6f
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,
);
} }
} }