fix issue where removing account could prevent application from starting

This commit is contained in:
zoe 2022-08-14 18:57:58 +02:00
parent b2342dde89
commit 475e3a4210
1 changed files with 4 additions and 0 deletions

View File

@ -98,6 +98,10 @@ class Settings {
{identityList[i]: await AccountSettings.create(identityList[i])});
}
settings.activeIdentity = settings.prefs.getString(activeIdentityKey) ?? "";
if (!settings.identities.containsKey(settings.activeIdentity) &&
settings.identities.isNotEmpty) {
settings.activeIdentity = settings.identities.keys.first;
}
return settings;
}