Merge branch 'master' of gitlab.com:famedly/famedlysdk

This commit is contained in:
Christian Pauly 2019-06-18 12:11:16 +02:00
commit 31ef612330
2 changed files with 3 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 != null && events.length > 0)
return events[0].getBody();
else
return "";

View file

@ -186,10 +186,11 @@ class Store {
final Map<String, dynamic> directMap = userUpdate.content["content"];
directMap.forEach((String key, dynamic value) {
if (value is List<dynamic> && value.length > 0)
for (int i = 0; i < value.length; i++)
for (int i = 0; i < value.length; i++) {
txn.rawUpdate(
"UPDATE Rooms SET direct_chat_matrix_id=? WHERE id=?",
[key, value[i]]);
}
});
}
break;