From 61b052c6475e9fe4465e8aa2d3933277018d8e2f Mon Sep 17 00:00:00 2001 From: Christian Pauly Date: Thu, 12 Sep 2019 12:35:57 +0200 Subject: [PATCH] [RoomList] Fix found algo --- lib/src/RoomList.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/src/RoomList.dart b/lib/src/RoomList.dart index b4c4460..58d5de4 100644 --- a/lib/src/RoomList.dart +++ b/lib/src/RoomList.dart @@ -96,7 +96,7 @@ class RoomList { for (j = 0; j < rooms.length; j++) { if (rooms[j].id == chatUpdate.id) break; } - final bool found = (j < rooms.length - 1 && rooms[j].id == chatUpdate.id); + final bool found = (j < rooms.length && rooms[j].id == chatUpdate.id); final bool isLeftRoom = chatUpdate.membership == Membership.leave; // Does the chat already exist in the list rooms?