From 2cd178e6844ecbe85707c241ad4b71a0bf89ffb0 Mon Sep 17 00:00:00 2001 From: Koji Arai Date: Sun, 10 Apr 2011 01:10:25 +0900 Subject: [PATCH] Fixed NullPointerException --- src/com/fsck/k9/mail/store/LocalStore.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/com/fsck/k9/mail/store/LocalStore.java b/src/com/fsck/k9/mail/store/LocalStore.java index d0ddd6ceb..ba02381ed 100644 --- a/src/com/fsck/k9/mail/store/LocalStore.java +++ b/src/com/fsck/k9/mail/store/LocalStore.java @@ -2375,10 +2375,12 @@ public class LocalStore extends Store implements Serializable { String contentDisposition = MimeUtility.unfoldAndDecode(attachment.getDisposition()); String dispositionType = contentDisposition; - int pos = dispositionType.indexOf(';'); - if (pos != -1) { - // extract the disposition-type, "attachment", "inline" or extension-token (see the RFC 2183) - dispositionType = dispositionType.substring(0, pos); + if (dispositionType != null) { + int pos = dispositionType.indexOf(';'); + if (pos != -1) { + // extract the disposition-type, "attachment", "inline" or extension-token (see the RFC 2183) + dispositionType = dispositionType.substring(0, pos); + } } if (name == null && contentDisposition != null) {