Fix disconnect warning

This commit is contained in:
Tobias Fella
2024-02-20 18:40:00 +01:00
parent 940929d044
commit 621c36f821

View File

@@ -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();