]> source.dussan.org Git - poi.git/commitdiff
Fix bug 54725 - HWPF where no parent style CHP exists, use an empty
authorNick Burch <nick@apache.org>
Thu, 31 Jul 2014 15:41:58 +0000 (15:41 +0000)
committerNick Burch <nick@apache.org>
Thu, 31 Jul 2014 15:41:58 +0000 (15:41 +0000)
 set when processing the style to avoid a NPE

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1614926 13f79535-47bb-0310-9956-ffa450edef68

src/scratchpad/src/org/apache/poi/hwpf/model/StyleSheet.java

index e780a486afc5afc584a703135241fa59c9567f69..ba213b7a4e477181db205ed6718700699ca89498 100644 (file)
@@ -278,14 +278,15 @@ public final class StyleSheet implements HDFType {
           CharacterProperties parentCHP = new CharacterProperties();
           if(baseIndex != NIL_STYLE)
           {
-
               parentCHP = _styleDescriptions[baseIndex].getCHP();
               if(parentCHP == null)
               {
                   createChp(baseIndex);
                   parentCHP = _styleDescriptions[baseIndex].getCHP();
               }
-
+              if(parentCHP == null) {
+                  parentCHP = new CharacterProperties();
+              }
           }
 
           chp = CharacterSprmUncompressor.uncompressCHP(parentCHP, chpx, 0);