From 60dd38d822434b800a74cb622ef7cac4654ec950 Mon Sep 17 00:00:00 2001 From: M66B Date: Sun, 2 Jun 2019 09:16:21 +0200 Subject: [PATCH] Small improvement --- app/src/main/java/eu/faircode/email/MessageHelper.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/MessageHelper.java b/app/src/main/java/eu/faircode/email/MessageHelper.java index a041b36738..0afa1eb2ce 100644 --- a/app/src/main/java/eu/faircode/email/MessageHelper.java +++ b/app/src/main/java/eu/faircode/email/MessageHelper.java @@ -976,14 +976,15 @@ public class MessageHelper { try { if (part.isMimeType("multipart/*")) { Multipart multipart; - final Object content = part.getContent(); + Object content = part.getContent(); if (content instanceof Multipart) multipart = (Multipart) part.getContent(); - else { + else if (content instanceof String) { String text = (String) content; String sample = text.substring(0, Math.min(80, text.length())); throw new ParseException(content.getClass().getName() + ": " + sample); - } + } else + throw new ParseException(content.getClass().getName()); for (int i = 0; i < multipart.getCount(); i++) try {