From 8a2ce9d9dfdfeab33aa38b06011c41fb56272843 Mon Sep 17 00:00:00 2001 From: Dominik Stadler Date: Mon, 18 Jan 2016 20:16:23 +0000 Subject: Fix possible NPE found with msg-file from CommonCrawl git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1725334 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/poi/hsmf/extractor/OutlookTextExtactor.java | 2 +- test-data/hsmf/logsat.com_signatures_valid.msg | Bin 0 -> 23040 bytes 2 files changed, 1 insertion(+), 1 deletion(-) create mode 100755 test-data/hsmf/logsat.com_signatures_valid.msg diff --git a/src/scratchpad/src/org/apache/poi/hsmf/extractor/OutlookTextExtactor.java b/src/scratchpad/src/org/apache/poi/hsmf/extractor/OutlookTextExtactor.java index be396f3b00..0d949dff56 100644 --- a/src/scratchpad/src/org/apache/poi/hsmf/extractor/OutlookTextExtactor.java +++ b/src/scratchpad/src/org/apache/poi/hsmf/extractor/OutlookTextExtactor.java @@ -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 index 0000000000..a074325109 Binary files /dev/null and b/test-data/hsmf/logsat.com_signatures_valid.msg differ -- cgit v1.2.3