From e7d8c4b69c2c19dde73f8feb71ae101db00a5bc7 Mon Sep 17 00:00:00 2001 From: Carl Schwan Date: Fri, 8 Jan 2021 21:26:56 +0100 Subject: [PATCH] Handle non-consistent configuration --- src/controller.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/controller.cpp b/src/controller.cpp index 99734d0fb..ba83ba8b3 100644 --- a/src/controller.cpp +++ b/src/controller.cpp @@ -258,9 +258,13 @@ void Controller::dropConnection(Connection *c) void Controller::invokeLogin() { const auto accounts = SettingsGroup("Accounts").childGroups(); - const QString id = NeoChatConfig::self()->activeConnection(); + QString id = NeoChatConfig::self()->activeConnection(); for (const auto &accountId : accounts) { AccountSettings account {accountId}; + if (id.isEmpty()) { + // handle case where the account config is empty + id = accountId; + } if (!account.homeserver().isEmpty()) { auto accessToken = loadAccessTokenFromKeyChain(account);