workaround for NPE caused by old Word format

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1142760 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Sergey Vladimirov 2011-07-04 19:03:45 +00:00
parent f26b6efa29
commit a57c397517

View File

@ -57,11 +57,17 @@ public final class CHPX extends BytePropertyNode
public CharacterProperties getCharacterProperties(StyleSheet ss, short istd)
{
CharacterProperties baseStyle = ss.getCharacterStyle(istd);
CharacterProperties baseStyle;
if (ss == null) {
//old document format
baseStyle = new CharacterProperties();
} else {
baseStyle = ss.getCharacterStyle(istd);
}
CharacterProperties props = CharacterSprmUncompressor.uncompressCHP(baseStyle, getGrpprl(), 0);
return props;
}
public String toString() {
return "CHPX from " + getStart() + " to " + getEnd() +
" (in bytes " + getStartBytes() + " to " + getEndBytes() + ")";