Handle non-consistent configuration

This commit is contained in:
Carl Schwan
2021-01-08 21:26:56 +01:00
parent 44d4269978
commit e7d8c4b69c

View File

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