Don't set initial room with an empty room list

This commit is contained in:
Konstantinos Sideris 2017-04-24 20:05:24 +03:00
parent 6d9acc8621
commit 9d9b5e4f68
1 changed files with 3 additions and 0 deletions

View File

@ -131,6 +131,9 @@ void RoomList::setInitialRooms(const Rooms &rooms)
ui->scrollVerticalLayout->insertWidget(pos, room_item); ui->scrollVerticalLayout->insertWidget(pos, room_item);
} }
if (rooms_.isEmpty())
return;
// TODO: Move this into its own function. // TODO: Move this into its own function.
auto first_room = rooms_.first(); auto first_room = rooms_.first();
first_room->setPressedState(true); first_room->setPressedState(true);