From 34ad743e9859c59c1482d45aa43f636143d09449 Mon Sep 17 00:00:00 2001 From: Tobias Fella Date: Wed, 22 Mar 2023 20:43:23 +0100 Subject: [PATCH] Don't crash in UserListModel when there is no room BUG: 466045 --- src/models/userlistmodel.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/models/userlistmodel.cpp b/src/models/userlistmodel.cpp index beec8978c..3a0f891e7 100644 --- a/src/models/userlistmodel.cpp +++ b/src/models/userlistmodel.cpp @@ -217,6 +217,9 @@ int UserListModel::findUserPos(Quotient::User *user) const int UserListModel::findUserPos(const QString &username) const { + if (!m_currentRoom) { + return 0; + } return m_currentRoom->memberSorter().lowerBoundIndex(m_users, username); }