From 408dfcbf432aa9735e5f1bd8a4d4584de2628062 Mon Sep 17 00:00:00 2001 From: M66B Date: Sun, 17 May 2020 15:52:00 +0200 Subject: [PATCH] Prevent crash --- .../java/eu/faircode/email/FragmentMessages.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/FragmentMessages.java b/app/src/main/java/eu/faircode/email/FragmentMessages.java index 6ad0eeafe5..b1c33dfb08 100644 --- a/app/src/main/java/eu/faircode/email/FragmentMessages.java +++ b/app/src/main/java/eu/faircode/email/FragmentMessages.java @@ -3004,8 +3004,7 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences. outState.putStringArray("fair:values", values.keySet().toArray(new String[0])); for (String name : values.keySet()) - if (!"selected".equals(name)) - outState.putLongArray("fair:name:" + name, Helper.toLongArray(values.get(name))); + outState.putLongArray("fair:name:" + name, Helper.toLongArray(values.get(name))); if (rvMessage != null) { Parcelable rv = rvMessage.getLayoutManager().onSaveInstanceState(); @@ -3027,11 +3026,12 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences. autoExpanded = savedInstanceState.getBoolean("fair:autoExpanded"); autoCloseCount = savedInstanceState.getInt("fair:autoCloseCount"); - for (String name : savedInstanceState.getStringArray("fair:values")) { - values.put(name, new ArrayList()); - for (Long value : savedInstanceState.getLongArray("fair:name:" + name)) - values.get(name).add(value); - } + for (String name : savedInstanceState.getStringArray("fair:values")) + if (!"selected".equals(name)) { + values.put(name, new ArrayList<>()); + for (Long value : savedInstanceState.getLongArray("fair:name:" + name)) + values.get(name).add(value); + } if (rvMessage != null) { Parcelable rv = savedInstanceState.getParcelable("fair:rv");