From a247509aa12c9f72dc9b3c8f517ec4d03156e835 Mon Sep 17 00:00:00 2001 From: Andy Scherzinger Date: Sun, 2 May 2021 23:28:36 +0200 Subject: [PATCH] add nullchecks since elements are annotated as nullable Signed-off-by: Andy Scherzinger --- .../talk/controllers/ContactsController.java | 23 +++++++++++++------ 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/com/nextcloud/talk/controllers/ContactsController.java b/app/src/main/java/com/nextcloud/talk/controllers/ContactsController.java index a0f4ff797..743e587c6 100644 --- a/app/src/main/java/com/nextcloud/talk/controllers/ContactsController.java +++ b/app/src/main/java/com/nextcloud/talk/controllers/ContactsController.java @@ -128,6 +128,7 @@ public class ContactsController extends BaseController implements SearchView.OnQ @BindView(R.id.loading_content) LinearLayout loadingContent; + @BindView(R.id.recycler_view) RecyclerView recyclerView; @@ -152,9 +153,6 @@ public class ContactsController extends BaseController implements SearchView.OnQ @BindView(R.id.generic_rv_layout) CoordinatorLayout genericRvLayout; - @Inject - NcApi ncApi; - @Inject UserUtils userUtils; @@ -164,6 +162,9 @@ public class ContactsController extends BaseController implements SearchView.OnQ @Inject AppPreferences appPreferences; + @Inject + NcApi ncApi; + private String credentials; private UserEntity currentUser; private Disposable contactsQueryDisposable; @@ -996,11 +997,19 @@ public class ContactsController extends BaseController implements SearchView.OnQ private void toggleNewCallHeaderVisibility(boolean showInitialLayout) { if (showInitialLayout) { - initialRelativeLayout.setVisibility(View.VISIBLE); - secondaryRelativeLayout.setVisibility(View.GONE); + if (initialRelativeLayout != null) { + initialRelativeLayout.setVisibility(View.VISIBLE); + } + if (secondaryRelativeLayout != null) { + secondaryRelativeLayout.setVisibility(View.GONE); + } } else { - initialRelativeLayout.setVisibility(View.GONE); - secondaryRelativeLayout.setVisibility(View.VISIBLE); + if (initialRelativeLayout != null) { + initialRelativeLayout.setVisibility(View.GONE); + } + if (secondaryRelativeLayout != null) { + secondaryRelativeLayout.setVisibility(View.VISIBLE); + } } } }