From 86f2bc0d68dbae910732ff35ba0019f0895ca738 Mon Sep 17 00:00:00 2001 From: M66B Date: Sat, 16 Jan 2021 18:45:18 +0100 Subject: [PATCH] Prevent crash --- app/src/main/java/eu/faircode/email/FragmentMessages.java | 6 +++++- 1 file changed, 5 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 ab78416d7a..52c3f65023 100644 --- a/app/src/main/java/eu/faircode/email/FragmentMessages.java +++ b/app/src/main/java/eu/faircode/email/FragmentMessages.java @@ -7456,7 +7456,11 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences. PrintJob job = printManager.print(jobName, adapter, new PrintAttributes.Builder().build()); EntityLog.log(context, "Print queued job=" + job.getInfo()); } catch (Throwable ex) { - Log.unexpectedError(getParentFragmentManager(), ex, !(ex instanceof ActivityNotFoundException)); + try { + Log.unexpectedError(getParentFragmentManager(), ex, !(ex instanceof ActivityNotFoundException)); + } catch (IllegalStateException exex) { + ToastEx.makeText(context, Log.formatThrowable(ex), Toast.LENGTH_LONG).show(); + } } finally { printWebView = null; }