From 6c0761c06d6a3d15310471b93631de6857e146c8 Mon Sep 17 00:00:00 2001 From: M66B Date: Fri, 12 Feb 2021 17:12:39 +0100 Subject: [PATCH] Prevent crash --- app/src/main/java/eu/faircode/email/ActivitySignature.java | 2 ++ app/src/main/java/eu/faircode/email/FragmentAnswer.java | 2 ++ app/src/main/java/eu/faircode/email/FragmentCompose.java | 2 ++ 3 files changed, 6 insertions(+) diff --git a/app/src/main/java/eu/faircode/email/ActivitySignature.java b/app/src/main/java/eu/faircode/email/ActivitySignature.java index dd0a4d1b19..f4d7b7c515 100644 --- a/app/src/main/java/eu/faircode/email/ActivitySignature.java +++ b/app/src/main/java/eu/faircode/email/ActivitySignature.java @@ -197,6 +197,8 @@ public class ActivitySignature extends ActivityBase { etText.setText(HtmlHelper.fromHtml(html, new Html.ImageGetter() { @Override public Drawable getDrawable(String source) { + if (source != null && source.startsWith("cid:")) + source = null; return ImageHelper.decodeImage(ActivitySignature.this, -1, source, true, 0, 1.0f, etText); } }, null, this)); diff --git a/app/src/main/java/eu/faircode/email/FragmentAnswer.java b/app/src/main/java/eu/faircode/email/FragmentAnswer.java index fcce7da608..8c2947aa45 100644 --- a/app/src/main/java/eu/faircode/email/FragmentAnswer.java +++ b/app/src/main/java/eu/faircode/email/FragmentAnswer.java @@ -196,6 +196,8 @@ public class FragmentAnswer extends FragmentBase { etText.setText(HtmlHelper.fromHtml(answer.text, new Html.ImageGetter() { @Override public Drawable getDrawable(String source) { + if (source != null && source.startsWith("cid:")) + source = null; return ImageHelper.decodeImage(getContext(), -1, source, true, 0, 1.0f, etText); } }, null, getContext())); diff --git a/app/src/main/java/eu/faircode/email/FragmentCompose.java b/app/src/main/java/eu/faircode/email/FragmentCompose.java index 02c5dedebf..04b86d8684 100644 --- a/app/src/main/java/eu/faircode/email/FragmentCompose.java +++ b/app/src/main/java/eu/faircode/email/FragmentCompose.java @@ -1647,6 +1647,8 @@ public class FragmentCompose extends FragmentBase { Spanned spanned = HtmlHelper.fromHtml(html, new Html.ImageGetter() { @Override public Drawable getDrawable(String source) { + if (source != null && source.startsWith("cid:")) + source = null; return ImageHelper.decodeImage(getContext(), working, source, true, zoom, 1.0f, etBody); } }, null, getContext());