From 6dfc29134119eb778c521efdf863442f93c79e22 Mon Sep 17 00:00:00 2001 From: M66B Date: Sat, 23 Apr 2022 10:21:13 +0200 Subject: [PATCH] Prevent crash --- app/src/main/java/eu/faircode/email/FragmentMessages.java | 2 ++ app/src/main/java/eu/faircode/email/FragmentSetup.java | 2 ++ 2 files changed, 4 insertions(+) diff --git a/app/src/main/java/eu/faircode/email/FragmentMessages.java b/app/src/main/java/eu/faircode/email/FragmentMessages.java index 5403f28b94..9081020ebf 100644 --- a/app/src/main/java/eu/faircode/email/FragmentMessages.java +++ b/app/src/main/java/eu/faircode/email/FragmentMessages.java @@ -1993,6 +1993,8 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences. @Override public void run() { try { + if (!getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.STARTED)) + return; if (adapter != null) adapter.notifyItemChanged(pos); } catch (Throwable ex) { diff --git a/app/src/main/java/eu/faircode/email/FragmentSetup.java b/app/src/main/java/eu/faircode/email/FragmentSetup.java index ee5a41b0c1..547651d468 100644 --- a/app/src/main/java/eu/faircode/email/FragmentSetup.java +++ b/app/src/main/java/eu/faircode/email/FragmentSetup.java @@ -807,6 +807,8 @@ public class FragmentSetup extends FragmentBase { @Override public void run() { try { + if (!getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.STARTED)) + return; Rect rect = new Rect( vwWelcome.getLeft(), ibWelcome.getTop(),