From 555144babe38e22a37d9f154001a1295bdb9b1e6 Mon Sep 17 00:00:00 2001 From: Maxim Valyanskiy Date: Fri, 16 Sep 2011 15:38:50 +0000 Subject: [PATCH] MAPIMessage: fix NPE in set7BitEncoding git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1171628 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/org/apache/poi/hsmf/MAPIMessage.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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) { -- 2.39.5