From 3fa8081e88e0b035377c721fd21676a735d82baf Mon Sep 17 00:00:00 2001 From: cketti Date: Sat, 17 Mar 2012 03:19:09 +0100 Subject: [PATCH] Fixed MimeUtility.extractTextual() when loading messages from the server --- src/com/fsck/k9/mail/internet/MimeUtility.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/com/fsck/k9/mail/internet/MimeUtility.java b/src/com/fsck/k9/mail/internet/MimeUtility.java index 20486232c..eb6948c11 100644 --- a/src/com/fsck/k9/mail/internet/MimeUtility.java +++ b/src/com/fsck/k9/mail/internet/MimeUtility.java @@ -3304,12 +3304,12 @@ public class MimeUtility { MimeMultipart multipart = (MimeMultipart) firstBody; for (int i = 0, count = multipart.getCount(); i < count; i++) { BodyPart bodyPart = multipart.getBodyPart(i); - if (bodyPart.getBody() instanceof TextBody) { - TextBody textBody = (TextBody) bodyPart.getBody(); - if ("".equals(text) && bodyPart.isMimeType("text/plain")) { - text = textBody.getText(); - } else if ("".equals(html) && bodyPart.isMimeType("text/html")) { - html = textBody.getText(); + String bodyText = getTextFromPart(bodyPart); + if (bodyText != null) { + if (text.length() == 0 && bodyPart.isMimeType("text/plain")) { + text = bodyText; + } else if (html.length() == 0 && bodyPart.isMimeType("text/html")) { + html = bodyText; } } }