Room.events must not be null

This commit is contained in:
Christian Pauly 2019-06-14 07:40:11 +02:00
parent 5c015608c0
commit 36c17c7fca
1 changed files with 2 additions and 2 deletions

View File

@ -130,7 +130,7 @@ class Room {
/// The last message sent to this room.
String get lastMessage {
if (events.length > 0)
if (events?.length > 0)
return events[0].getBody();
else
return "";
@ -138,7 +138,7 @@ class Room {
/// When the last message received.
ChatTime get timeCreated {
if (events.length > 0)
if (events?.length > 0)
return events[0].time;
else
return ChatTime.now();