From 650f7ac85e8ca11d6971bac95fa95429f47b7900 Mon Sep 17 00:00:00 2001 From: M66B Date: Mon, 28 Sep 2020 22:15:31 +0200 Subject: [PATCH] Prevent crash --- .../java/eu/faircode/email/FragmentMessages.java | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/eu/faircode/email/FragmentMessages.java b/app/src/main/java/eu/faircode/email/FragmentMessages.java index e2c8a31034..d063b975d9 100644 --- a/app/src/main/java/eu/faircode/email/FragmentMessages.java +++ b/app/src/main/java/eu/faircode/email/FragmentMessages.java @@ -5410,7 +5410,7 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences. else if (ACTION_DECRYPT.equals(action)) onDecrypt(intent); else if (ACTION_KEYWORDS.equals(action)) - adapter.notifyDataSetChanged(); + onKeywords(intent); } } }; @@ -5532,6 +5532,19 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences. } } + private void onKeywords(Intent intent) { + rvMessage.post(new Runnable() { + @Override + public void run() { + try { + adapter.notifyDataSetChanged(); + } catch (Throwable ex) { + Log.e(ex); + } + } + }); + } + @Override public void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data);