Check if the room is valid before trying to refresh users
This commit is contained in:
@@ -163,6 +163,7 @@ void UserListModel::refreshAllUsers()
|
||||
}
|
||||
m_users.clear();
|
||||
|
||||
if (m_currentRoom != nullptr) {
|
||||
m_users = m_currentRoom->users();
|
||||
std::sort(m_users.begin(), m_users.end(), m_currentRoom->memberSorter());
|
||||
|
||||
@@ -174,6 +175,7 @@ void UserListModel::refreshAllUsers()
|
||||
connect(m_currentRoom->connection(), &Connection::loggedOut, this, [this]() {
|
||||
setRoom(nullptr);
|
||||
});
|
||||
}
|
||||
endResetModel();
|
||||
Q_EMIT usersRefreshed();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user