From 21b4234da5d42f8003c6ba15758f4fddcdc55c7b Mon Sep 17 00:00:00 2001 From: M66B Date: Sun, 27 Mar 2022 07:50:07 +0200 Subject: [PATCH] Prevent crash --- app/src/main/java/eu/faircode/email/FragmentContacts.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/eu/faircode/email/FragmentContacts.java b/app/src/main/java/eu/faircode/email/FragmentContacts.java index df89d3fc5c..31a65bddb3 100644 --- a/app/src/main/java/eu/faircode/email/FragmentContacts.java +++ b/app/src/main/java/eu/faircode/email/FragmentContacts.java @@ -130,7 +130,7 @@ public class FragmentContacts extends FragmentBase { @Override public void onSaveInstanceState(Bundle outState) { - outState.putLong("fair:account", account); + outState.putLong("fair:account", account == null ? -1L : account); outState.putBoolean("fair:junk", junk); outState.putString("fair:searching", searching); outState.putLong("fair:selected_account", selected_account); @@ -146,6 +146,9 @@ public class FragmentContacts extends FragmentBase { junk = savedInstanceState.getBoolean("fair:junk"); searching = savedInstanceState.getString("fair:searching"); selected_account = savedInstanceState.getLong("fair:selected_account"); + + if (account < 0) + account = null; } onMenuJunk(junk);