Fix segfault/assert when logging out of account

This commit is contained in:
Tobias Fella
2020-12-28 00:07:37 +00:00
parent b1080df9dd
commit 0fe0f45944
2 changed files with 7 additions and 1 deletions

View File

@@ -196,7 +196,7 @@ void Controller::logout(Connection *conn, bool serverSideLogout)
conn->stopSync();
Q_EMIT conn->stateChanged();
Q_EMIT conn->loggedOut();
if (!m_connections.isEmpty()) {
if (conn == activeConnection() && !m_connections.isEmpty()) {
setActiveConnection(m_connections[0]);
} else {
setActiveConnection(nullptr);