[Room] LastEvent can be null

This commit is contained in:
Christian Pauly 2019-08-29 10:05:17 +02:00
parent 6d143241eb
commit 19d06920e2

View file

@ -126,7 +126,7 @@ class Room {
Event get lastEvent { Event get lastEvent {
ChatTime lastTime = ChatTime(0); ChatTime lastTime = ChatTime(0);
Event lastEvent = Event(); Event lastEvent = null;
states.forEach((String key, RoomState state) { states.forEach((String key, RoomState state) {
if (state.time > lastTime) { if (state.time > lastTime) {
lastTime = state.time; lastTime = state.time;