From 9576f34b3c7f0a27165b3d1a6d1422898397e22d Mon Sep 17 00:00:00 2001 From: M66B Date: Thu, 6 Dec 2018 08:24:15 +0100 Subject: [PATCH] Prevent crash --- app/src/main/java/eu/faircode/email/FragmentMessages.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/FragmentMessages.java b/app/src/main/java/eu/faircode/email/FragmentMessages.java index bb885667ea..fa5f43a325 100644 --- a/app/src/main/java/eu/faircode/email/FragmentMessages.java +++ b/app/src/main/java/eu/faircode/email/FragmentMessages.java @@ -388,10 +388,8 @@ public class FragmentMessages extends FragmentEx { public void onSelectionChanged() { swipeRefresh.setEnabled(false); if (selectionTracker.hasSelection()) { - if (messages != null) { + if (messages != null) messages.removeObservers(getViewLifecycleOwner()); - messages = null; - } fabMore.show(); } else { predicate.clearAccount(); @@ -1564,8 +1562,7 @@ public class FragmentMessages extends FragmentEx { @Override public void onLoaded() { pbWait.setVisibility(View.GONE); - if (messages != null && - messages.getValue() == null || messages.getValue().size() == 0) + if (messages.getValue() == null || messages.getValue().size() == 0) tvNoEmail.setVisibility(View.VISIBLE); }