]> source.dussan.org Git - poi.git/commitdiff
MAPIMessage: fix NPE in set7BitEncoding
authorMaxim Valyanskiy <maxcom@apache.org>
Fri, 16 Sep 2011 15:38:50 +0000 (15:38 +0000)
committerMaxim Valyanskiy <maxcom@apache.org>
Fri, 16 Sep 2011 15:38:50 +0000 (15:38 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1171628 13f79535-47bb-0310-9956-ffa450edef68

src/scratchpad/src/org/apache/poi/hsmf/MAPIMessage.java

index 91c4c7479c080ee8308f74d9d985b2b91469b716..b105c8b4e6d413b70a5fb9f0a10c0fe3b2150922 100644 (file)
@@ -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) {