From e4f9665ef08970df5d81f403e4eb44f4a1db7abc Mon Sep 17 00:00:00 2001 From: M66B Date: Mon, 6 Apr 2020 18:42:02 +0200 Subject: [PATCH] Simplification/fix --- app/src/main/java/eu/faircode/email/MessageHelper.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/MessageHelper.java b/app/src/main/java/eu/faircode/email/MessageHelper.java index 057cd79c4a..f343a742f0 100644 --- a/app/src/main/java/eu/faircode/email/MessageHelper.java +++ b/app/src/main/java/eu/faircode/email/MessageHelper.java @@ -1873,17 +1873,16 @@ public class MessageHelper { ContentType contentType; try { - String c = part.getContentType(); - contentType = new ContentType( - TextUtils.isEmpty(c) ? "application/octet-stream" : c); + contentType = new ContentType(part.getContentType()); } catch (ParseException ex) { - Log.e(ex); - parts.warnings.add(Log.formatThrowable(ex, false)); + Log.w(ex); if (part instanceof MimeMessage) contentType = new ContentType("text/html"); else contentType = new ContentType(Helper.guessMimeType(filename)); + + Log.i("Content type guessed=" + contentType); } boolean plain = "text/plain".equalsIgnoreCase(contentType.getBaseType());