]> source.dussan.org Git - poi.git/commitdiff
Fix possible NPE found with msg-file from CommonCrawl
authorDominik Stadler <centic@apache.org>
Mon, 18 Jan 2016 20:16:23 +0000 (20:16 +0000)
committerDominik Stadler <centic@apache.org>
Mon, 18 Jan 2016 20:16:23 +0000 (20:16 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1725334 13f79535-47bb-0310-9956-ffa450edef68

src/scratchpad/src/org/apache/poi/hsmf/extractor/OutlookTextExtactor.java
test-data/hsmf/logsat.com_signatures_valid.msg [new file with mode: 0755]

index be396f3b00112db90ef1ad68b06f49986684f64f..0d949dff56b34027e5c991d4d6b0db221f9cea00 100644 (file)
@@ -153,7 +153,7 @@ public class OutlookTextExtactor extends POIOLE2TextExtractor {
       for(AttachmentChunks att : msg.getAttachmentFiles()) {
          StringChunk name = att.attachLongFileName;
          if (name == null) name = att.attachFileName;
-         String attName = name.getValue();
+         String attName = name == null ? null : name.getValue();
           
          if(att.attachMimeTag != null && 
                att.attachMimeTag.getValue() != null) {
diff --git a/test-data/hsmf/logsat.com_signatures_valid.msg b/test-data/hsmf/logsat.com_signatures_valid.msg
new file mode 100755 (executable)
index 0000000..a074325
Binary files /dev/null and b/test-data/hsmf/logsat.com_signatures_valid.msg differ