From 5b0f0a3bfdd28c91c15c59fe5c71c269cd8944b4 Mon Sep 17 00:00:00 2001 From: tobiasKaminsky Date: Fri, 22 Jun 2018 08:34:33 +0200 Subject: [PATCH] account may be null Signed-off-by: tobiasKaminsky --- .../android/ui/activity/ManageAccountsActivity.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/owncloud/android/ui/activity/ManageAccountsActivity.java b/src/main/java/com/owncloud/android/ui/activity/ManageAccountsActivity.java index a08bc3c130..274e30c2ba 100644 --- a/src/main/java/com/owncloud/android/ui/activity/ManageAccountsActivity.java +++ b/src/main/java/com/owncloud/android/ui/activity/ManageAccountsActivity.java @@ -111,9 +111,14 @@ public class ManageAccountsActivity extends FileActivity Account[] accountList = AccountManager.get(this).getAccountsByType(MainApp.getAccountType(this)); mOriginalAccounts = DisplayUtils.toAccountNameSet(Arrays.asList(accountList)); - mOriginalCurrentAccount = AccountUtils.getCurrentOwnCloudAccount(this).name; - setAccount(AccountUtils.getCurrentOwnCloudAccount(this)); + Account currentAccount = AccountUtils.getCurrentOwnCloudAccount(this); + + if (currentAccount != null) { + mOriginalCurrentAccount = currentAccount.name; + } + + setAccount(currentAccount); onAccountSet(false); arbitraryDataProvider = new ArbitraryDataProvider(getContentResolver());