Fix off by 1 in previousRoom condition

This commit is contained in:
Nicolas Werner 2021-06-18 14:13:01 +02:00
parent e6edb1daa3
commit c69d2ef648
No known key found for this signature in database
GPG key ID: C8D75E610773F2D9

View file

@ -662,7 +662,7 @@ FilteredRoomlistModel::previousRoom()
if (r) { if (r) {
int idx = roomidToIndex(r->roomId()); int idx = roomidToIndex(r->roomId());
idx--; idx--;
if (idx > 0) { if (idx >= 0) {
setCurrentRoom( setCurrentRoom(
data(index(idx, 0), RoomlistModel::Roles::RoomId).toString()); data(index(idx, 0), RoomlistModel::Roles::RoomId).toString());
} }