diff --git a/MSGViewer/src/main/java/net/sourceforge/MSGViewer/factory/mbox/JavaMailParser.java b/MSGViewer/src/main/java/net/sourceforge/MSGViewer/factory/mbox/JavaMailParser.java index 3eb0553..1fe2d0b 100644 --- a/MSGViewer/src/main/java/net/sourceforge/MSGViewer/factory/mbox/JavaMailParser.java +++ b/MSGViewer/src/main/java/net/sourceforge/MSGViewer/factory/mbox/JavaMailParser.java @@ -106,7 +106,12 @@ private static void parse(Message msg, Part part) throws MessagingException, IOE MimePart mpart = (MimePart) part; FileAttachment att = new FileAttachment(); - String filename = MimeUtility.decodeText(part.getFileName()); + String filename = part.getFileName(); + if (filename != null) { + filename = MimeUtility.decodeText(filename); + } else { + filename = "unknown"; + } att.setMimeTag(getMime(part.getContentType())); att.setLongFilename(filename);