From f6a44a33da283a1b7f4989e279e7952829c2fa4f Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Thu, 3 Sep 2020 09:13:48 +0300 Subject: [PATCH] AccountActivity: fix crash when removing account. --- .../java/com/etesync/syncadapter/ui/AccountActivity.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/etesync/syncadapter/ui/AccountActivity.kt b/app/src/main/java/com/etesync/syncadapter/ui/AccountActivity.kt index 455b1fe9..55659693 100644 --- a/app/src/main/java/com/etesync/syncadapter/ui/AccountActivity.kt +++ b/app/src/main/java/com/etesync/syncadapter/ui/AccountActivity.kt @@ -407,7 +407,12 @@ class AccountActivity : BaseActivity(), Toolbar.OnMenuItemClickListener, PopupMe override fun loadInBackground(): AccountInfo { val info = AccountInfo() - val settings = AccountSettings(context, account) + val settings: AccountSettings + try { + settings = AccountSettings(context, account) + } catch (e: InvalidAccountException) { + return info + } if (settings.isLegacy) { val data = (context.applicationContext as App).data