diff --git a/src/models/roomtreemodel.cpp b/src/models/roomtreemodel.cpp index c8fb7d3e0..b02017168 100644 --- a/src/models/roomtreemodel.cpp +++ b/src/models/roomtreemodel.cpp @@ -37,7 +37,9 @@ void RoomTreeModel::setConnection(NeoChatConnection *connection) if (m_connection == connection) { return; } - disconnect(m_connection.get(), nullptr, this, nullptr); + if (m_connection) { + disconnect(m_connection.get(), nullptr, this, nullptr); + } m_connection = connection; beginResetModel(); initializeCategories();