Fix a crash on public room list

It's maybe a workaround, as it should not happen, but at least it will not crash anymore
This commit is contained in:
Benoit Marty 2019-12-18 09:56:58 +01:00
parent 79f11ad686
commit 08970ad8c1

View file

@ -178,7 +178,9 @@ class RoomDirectoryViewModel @AssistedInject constructor(@Assisted initialState:
copy(
asyncPublicRoomsRequest = Success(data.chunk!!),
// It's ok to append at the end of the list, so I use publicRooms.size()
publicRooms = publicRooms.appendAt(data.chunk!!, publicRooms.size),
publicRooms = publicRooms.appendAt(data.chunk!!, publicRooms.size)
// Rageshake #8206 tells that we can have several times the same room
.distinctBy { it.roomId },
hasMore = since != null
)
}