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 379844492d
commit 6f98350f11
1 changed files with 8 additions and 2 deletions

View File

@ -57,7 +57,13 @@ 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;
}