Room.events must not be null
This commit is contained in:
parent
5c015608c0
commit
36c17c7fca
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue