From cb55e32355e3bcad0e8290d92ac5c6999872884d Mon Sep 17 00:00:00 2001 From: Mario Danic Date: Sun, 21 Jan 2018 08:29:14 +0100 Subject: [PATCH] Protect against action bar Signed-off-by: Mario Danic --- .../com/nextcloud/talk/controllers/CallsListController.java | 4 +++- .../com/nextcloud/talk/controllers/SettingsController.java | 5 ++++- .../nextcloud/talk/controllers/SwitchAccountController.java | 4 +++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/nextcloud/talk/controllers/CallsListController.java b/app/src/main/java/com/nextcloud/talk/controllers/CallsListController.java index b96fda0cd..6109ab0f6 100644 --- a/app/src/main/java/com/nextcloud/talk/controllers/CallsListController.java +++ b/app/src/main/java/com/nextcloud/talk/controllers/CallsListController.java @@ -130,7 +130,9 @@ public class CallsListController extends BaseController implements SearchView.On super.onViewBound(view); NextcloudTalkApplication.getSharedApplication().getComponentApplication().inject(this); - getActionBar().show(); + if (getActionBar() != null) { + getActionBar().show(); + } userEntity = userUtils.getCurrentUser(); diff --git a/app/src/main/java/com/nextcloud/talk/controllers/SettingsController.java b/app/src/main/java/com/nextcloud/talk/controllers/SettingsController.java index 6f2412ab2..99f0918bc 100644 --- a/app/src/main/java/com/nextcloud/talk/controllers/SettingsController.java +++ b/app/src/main/java/com/nextcloud/talk/controllers/SettingsController.java @@ -234,7 +234,10 @@ public class SettingsController extends BaseController { @Override protected void onAttach(@NonNull View view) { super.onAttach(view); - getActionBar().show(); + + if (getActionBar() != null) { + getActionBar().show(); + } dispose(null); userEntity = userUtils.getCurrentUser(); diff --git a/app/src/main/java/com/nextcloud/talk/controllers/SwitchAccountController.java b/app/src/main/java/com/nextcloud/talk/controllers/SwitchAccountController.java index 7f302c968..aa87c3c26 100644 --- a/app/src/main/java/com/nextcloud/talk/controllers/SwitchAccountController.java +++ b/app/src/main/java/com/nextcloud/talk/controllers/SwitchAccountController.java @@ -179,7 +179,9 @@ public class SwitchAccountController extends BaseController { adapter.addListener(onSwitchItemClickListener); adapter.updateDataSet(userItems, false); } else { - getActionBar().show(); + if (getActionBar() != null) { + getActionBar().show(); + } Account account; ImportAccount importAccount; for (Object accountObject : AccountUtils.findAccounts(userUtils.getUsers())) {