diff --git a/src/libneochat/accountmanager.cpp b/src/libneochat/accountmanager.cpp index 763f7a504..693549472 100644 --- a/src/libneochat/accountmanager.cpp +++ b/src/libneochat/accountmanager.cpp @@ -173,7 +173,7 @@ void AccountManager::addConnection(NeoChatConnection *connection) }); connect(connection, &NeoChatConnection::loggedOut, this, [this, connection] { // Only set the connection if the account being logged out is currently active - if (m_accountRegistry->accounts().count() > 1 && connection == activeConnection()) { + if (m_accountRegistry->accounts().count() == 1 && connection == activeConnection()) { setActiveConnection(dynamic_cast(m_accountRegistry->accounts()[0])); } else { setActiveConnection(nullptr);