From 621c36f821600bb94f0c1c8f86a172543b2ca903 Mon Sep 17 00:00:00 2001 From: Tobias Fella Date: Tue, 20 Feb 2024 18:40:00 +0100 Subject: [PATCH] Fix disconnect warning --- src/models/roomtreemodel.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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();