From 8fc714ac4ae5203298bc88ded6112d8ddf686b22 Mon Sep 17 00:00:00 2001 From: cketti Date: Mon, 16 May 2011 00:36:46 +0200 Subject: [PATCH] Don't show "null" for partially downloaded messages with empty text body --- src/com/fsck/k9/mail/store/LocalStore.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/com/fsck/k9/mail/store/LocalStore.java b/src/com/fsck/k9/mail/store/LocalStore.java index ad487af06..c0607cd39 100644 --- a/src/com/fsck/k9/mail/store/LocalStore.java +++ b/src/com/fsck/k9/mail/store/LocalStore.java @@ -2074,6 +2074,15 @@ public class LocalStore extends Store implements Serializable { for (Part viewable : viewables) { try { String text = MimeUtility.getTextFromPart(viewable); + + /* + * Small hack to make sure the string "null" doesn't end up + * in one of the StringBuffers. + */ + if (text == null) { + text = ""; + } + /* * Anything with MIME type text/html will be stored as such. Anything * else will be stored as text/plain. @@ -2179,6 +2188,15 @@ public class LocalStore extends Store implements Serializable { Part viewable = viewables.get(i); try { String text = MimeUtility.getTextFromPart(viewable); + + /* + * Small hack to make sure the string "null" doesn't end up + * in one of the StringBuffers. + */ + if (text == null) { + text = ""; + } + /* * Anything with MIME type text/html will be stored as such. Anything * else will be stored as text/plain.