diff --git a/src/com/fsck/k9/mail/store/LocalStore.java b/src/com/fsck/k9/mail/store/LocalStore.java index d0ddd6cebbf..ba02381ed19 100644 --- a/src/com/fsck/k9/mail/store/LocalStore.java +++ b/src/com/fsck/k9/mail/store/LocalStore.java @@ -2375,10 +2375,12 @@ public Void doDbWork(final SQLiteDatabase db) throws WrappedException, Unavailab 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) {