From a86a92d7b7572cb03c3181051463e0db6b87ac50 Mon Sep 17 00:00:00 2001 From: M66B Date: Sat, 11 May 2019 07:52:30 +0200 Subject: [PATCH] Catch exceptions on get CID --- app/src/main/java/eu/faircode/email/MessageHelper.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/eu/faircode/email/MessageHelper.java b/app/src/main/java/eu/faircode/email/MessageHelper.java index 50cb776142..9a9c6db37a 100644 --- a/app/src/main/java/eu/faircode/email/MessageHelper.java +++ b/app/src/main/java/eu/faircode/email/MessageHelper.java @@ -989,7 +989,14 @@ public class MessageHelper { Log.w(ex); ct = new ContentType("application/octet-stream"); } - String[] cid = apart.part.getHeader("Content-ID"); + + String[] cid = null; + try { + cid = apart.part.getHeader("Content-ID"); + } catch (MessagingException ex) { + Log.w(ex); + parts.warnings.add(Helper.formatThrowable(ex)); + } apart.attachment = new EntityAttachment(); apart.attachment.name = apart.filename;