From: Nick Burch Date: Thu, 31 Jul 2014 15:41:58 +0000 (+0000) Subject: Fix bug 54725 - HWPF where no parent style CHP exists, use an empty X-Git-Tag: REL_3_11_BETA1~4 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=4eb322bae7e3fc8353f3a1f5290562ccf019a9e4;p=poi.git Fix bug 54725 - HWPF where no parent style CHP exists, use an empty 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 --- diff --git a/src/scratchpad/src/org/apache/poi/hwpf/model/StyleSheet.java b/src/scratchpad/src/org/apache/poi/hwpf/model/StyleSheet.java index e780a486af..ba213b7a4e 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/model/StyleSheet.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/model/StyleSheet.java @@ -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);