From 4a607e17e1d6191daaa98b3a317e9129f6cc4c04 Mon Sep 17 00:00:00 2001 From: Nick Burch Date: Wed, 15 Feb 2012 11:47:11 +0000 Subject: [PATCH] Fix bug #52664 - MAPIMessage may not always have name chunks when checking for 7 bit encodings git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1244449 13f79535-47bb-0310-9956-ffa450edef68 --- src/documentation/content/xdocs/status.xml | 1 + .../src/org/apache/poi/hsmf/MAPIMessage.java | 12 ++++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/documentation/content/xdocs/status.xml b/src/documentation/content/xdocs/status.xml index 0d5075e90d..665a6cb18b 100644 --- a/src/documentation/content/xdocs/status.xml +++ b/src/documentation/content/xdocs/status.xml @@ -34,6 +34,7 @@ + 52664 - MAPIMessage may not always have name chunks when checking for 7 bit encodings 52649 - fixed namespace issue in WordToFoConverter 52385 - avoid trancated array and vector data when reading OLE properties 52662 - CharacterRun NPE fix when fetching symbol fonts, where no fonts are defined diff --git a/src/scratchpad/src/org/apache/poi/hsmf/MAPIMessage.java b/src/scratchpad/src/org/apache/poi/hsmf/MAPIMessage.java index 570bc6d625..7c600e7014 100644 --- a/src/scratchpad/src/org/apache/poi/hsmf/MAPIMessage.java +++ b/src/scratchpad/src/org/apache/poi/hsmf/MAPIMessage.java @@ -451,13 +451,17 @@ public class MAPIMessage extends POIDocument { } } } - for(Chunk c : nameIdChunks.getAll()) { - if(c instanceof StringChunk) { - if( ((StringChunk)c).getType() == Types.ASCII_STRING ) { - return true; + + if (nameIdChunks!=null) { + for(Chunk c : nameIdChunks.getAll()) { + if(c instanceof StringChunk) { + if( ((StringChunk)c).getType() == Types.ASCII_STRING ) { + return true; + } } } } + for(RecipientChunks rc : recipientChunks) { for(Chunk c : rc.getAll()) { if(c instanceof StringChunk) { -- 2.39.5