From: Maxim Valyanskiy Date: Fri, 16 Sep 2011 15:38:50 +0000 (+0000) Subject: MAPIMessage: fix NPE in set7BitEncoding X-Git-Tag: REL_3_8_BETA5~166 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=555144babe38e22a37d9f154001a1295bdb9b1e6;p=poi.git MAPIMessage: fix NPE in set7BitEncoding git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1171628 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/scratchpad/src/org/apache/poi/hsmf/MAPIMessage.java b/src/scratchpad/src/org/apache/poi/hsmf/MAPIMessage.java index 91c4c7479c..b105c8b4e6 100644 --- a/src/scratchpad/src/org/apache/poi/hsmf/MAPIMessage.java +++ b/src/scratchpad/src/org/apache/poi/hsmf/MAPIMessage.java @@ -413,11 +413,15 @@ public class MAPIMessage extends POIDocument { ((StringChunk)c).set7BitEncoding(charset); } } - for(Chunk c : nameIdChunks.getAll()) { - if(c instanceof StringChunk) { - ((StringChunk)c).set7BitEncoding(charset); + + if (nameIdChunks!=null) { + for(Chunk c : nameIdChunks.getAll()) { + if(c instanceof StringChunk) { + ((StringChunk)c).set7BitEncoding(charset); + } } } + for(RecipientChunks rc : recipientChunks) { for(Chunk c : rc.getAll()) { if(c instanceof StringChunk) {