Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 04d97b4e authored by cketti's avatar cketti
Browse files

Don't crash when trying to remove certificates for incomplete accounts

parent 73d91000
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -36,7 +36,7 @@ class AccountRemover(

        preferences.deleteAccount(account)

        localKeyStoreManager.deleteCertificates(account)
        removeCertificates(account)
        Core.setServicesEnabled()

        Timber.v("Finished removing account '%s'.", accountName)
@@ -62,4 +62,12 @@ class AccountRemover(
            Timber.e(e, "Failed to reset remote store for account %s", account)
        }
    }

    private fun removeCertificates(account: Account) {
        try {
            localKeyStoreManager.deleteCertificates(account)
        } catch (e: Exception) {
            Timber.e(e, "Failed to remove certificates for account %s", account)
        }
    }
}