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.
|
/// The last message sent to this room.
|
||||||
String get lastMessage {
|
String get lastMessage {
|
||||||
if (events.length > 0)
|
if (events?.length > 0)
|
||||||
return events[0].getBody();
|
return events[0].getBody();
|
||||||
else
|
else
|
||||||
return "";
|
return "";
|
||||||
|
@ -138,7 +138,7 @@ class Room {
|
||||||
|
|
||||||
/// When the last message received.
|
/// When the last message received.
|
||||||
ChatTime get timeCreated {
|
ChatTime get timeCreated {
|
||||||
if (events.length > 0)
|
if (events?.length > 0)
|
||||||
return events[0].time;
|
return events[0].time;
|
||||||
else
|
else
|
||||||
return ChatTime.now();
|
return ChatTime.now();
|
||||||
|
|
Loading…
Reference in a new issue