From 0dbe8c0f2ccf017361cab2bb23061551da87f894 Mon Sep 17 00:00:00 2001 From: Marcel Hibbe Date: Mon, 11 Jul 2022 13:44:24 +0200 Subject: [PATCH] catch NPE for binding (loadCurrentStatus#onError) Signed-off-by: Marcel Hibbe --- .../talk/ui/dialog/ChooseAccountDialogFragment.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/nextcloud/talk/ui/dialog/ChooseAccountDialogFragment.java b/app/src/main/java/com/nextcloud/talk/ui/dialog/ChooseAccountDialogFragment.java index c9ccabb14..756d50129 100644 --- a/app/src/main/java/com/nextcloud/talk/ui/dialog/ChooseAccountDialogFragment.java +++ b/app/src/main/java/com/nextcloud/talk/ui/dialog/ChooseAccountDialogFragment.java @@ -233,7 +233,11 @@ public class ChooseAccountDialogFragment extends DialogFragment { @Override public void onError(@NonNull Throwable e) { Log.e(TAG, "Can't receive user status from server. ", e); - binding.statusView.setVisibility(View.GONE); + try { + binding.statusView.setVisibility(View.GONE); + } catch (NullPointerException npe) { + Log.i(TAG, "UI already teared down", npe); + } } @Override