1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-30 13:12:25 -05:00

Fixed NullPointerException

This commit is contained in:
Koji Arai 2011-04-10 01:10:25 +09:00
parent 996646e33a
commit 2cd178e684

View File

@ -2375,10 +2375,12 @@ public class LocalStore extends Store implements Serializable {
String contentDisposition = MimeUtility.unfoldAndDecode(attachment.getDisposition()); String contentDisposition = MimeUtility.unfoldAndDecode(attachment.getDisposition());
String dispositionType = contentDisposition; String dispositionType = contentDisposition;
int pos = dispositionType.indexOf(';'); if (dispositionType != null) {
if (pos != -1) { int pos = dispositionType.indexOf(';');
// extract the disposition-type, "attachment", "inline" or extension-token (see the RFC 2183) if (pos != -1) {
dispositionType = dispositionType.substring(0, pos); // extract the disposition-type, "attachment", "inline" or extension-token (see the RFC 2183)
dispositionType = dispositionType.substring(0, pos);
}
} }
if (name == null && contentDisposition != null) { if (name == null && contentDisposition != null) {