From afe4650e65e6cd56897201439ee353c68bf52c12 Mon Sep 17 00:00:00 2001 From: M66B Date: Sun, 21 Jun 2020 13:05:13 +0200 Subject: [PATCH] Added failsafe --- app/src/main/java/eu/faircode/email/FragmentMessages.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/FragmentMessages.java b/app/src/main/java/eu/faircode/email/FragmentMessages.java index 81b8bc85e2..a71b4c832d 100644 --- a/app/src/main/java/eu/faircode/email/FragmentMessages.java +++ b/app/src/main/java/eu/faircode/email/FragmentMessages.java @@ -4651,11 +4651,14 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences. @Override protected void onExecuted(Bundle args, final ArrayList result) { - ActivityView activity = (ActivityView) getActivity(); - if (activity == null) { + FragmentActivity factivity = getActivity(); + if (!(factivity instanceof ActivityView)) { Log.e("Undo: activity missing"); return; } + + ActivityView activity = (ActivityView) factivity; + View content = activity.getContentView(); if (content == null) { Log.e("Undo: view missing");