From c4365ed61d5c0bde2ec27d6a7977768d09ec23a6 Mon Sep 17 00:00:00 2001 From: Stephen Paul Weber Date: Thu, 16 Jan 2025 14:44:20 -0500 Subject: [PATCH] Fix NPE (cherry picked from commit 10aab53ff232bb7d0966dc90315c8d0497cfeaf3) --- .../conversations/ui/ConversationsOverviewFragment.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/eu/siacs/conversations/ui/ConversationsOverviewFragment.java b/src/main/java/eu/siacs/conversations/ui/ConversationsOverviewFragment.java index 355c36528..7d745cd14 100644 --- a/src/main/java/eu/siacs/conversations/ui/ConversationsOverviewFragment.java +++ b/src/main/java/eu/siacs/conversations/ui/ConversationsOverviewFragment.java @@ -512,7 +512,7 @@ public class ConversationsOverviewFragment extends XmppFragment { @Override protected void refresh() { - if (this.binding == null || this.activity == null) { + if (binding == null || this.activity == null) { Log.d(Config.LOGTAG,"ConversationsOverviewFragment.refresh() skipped updated because view binding or activity was null"); return; } @@ -554,8 +554,8 @@ public class ConversationsOverviewFragment extends XmppFragment { } setupSwipe(); - if (binding.overviewSnackbar != null) binding.overviewSnackbar.setVisibility(View.GONE); - if (activity.xmppConnectionService == null) return; + if (activity.xmppConnectionService == null || binding == null || binding.overviewSnackbar == null) return; + binding.overviewSnackbar.setVisibility(View.GONE); for (final var account : activity.xmppConnectionService.getAccounts()) { if (activity.getPreferences().getBoolean("no_mam_pref_warn:" + account.getUuid(), false)) continue; if (account.mamPrefs() != null && !"always".equals(account.mamPrefs().getAttribute("default"))) {