diff --git a/src/rooms/models/roomtreemodel.cpp b/src/rooms/models/roomtreemodel.cpp index d9640f405..ad5657c23 100644 --- a/src/rooms/models/roomtreemodel.cpp +++ b/src/rooms/models/roomtreemodel.cpp @@ -397,7 +397,7 @@ QVariant RoomTreeModel::data(const QModelIndex &index, int role) const QModelIndex RoomTreeModel::indexForRoom(NeoChatRoom *room) const { - if (room == nullptr) { + if (room == nullptr || m_connection == nullptr) { return {}; }