hwpf: ignore invalid style reference

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1095664 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Maxim Valyanskiy 2011-04-21 11:49:03 +00:00
parent 6d6c2fc68f
commit 98860bdcec

View File

@ -316,7 +316,12 @@ public final class StyleSheet implements HDFType {
{ {
return NIL_CHP; return NIL_CHP;
} }
return (_styleDescriptions[x] != null ? _styleDescriptions[x].getCHP() : null);
if (x>=_styleDescriptions.length) {
return NIL_CHP;
}
return (_styleDescriptions[x] != null ? _styleDescriptions[x].getCHP() : NIL_CHP);
} }
public ParagraphProperties getParagraphStyle(int x) public ParagraphProperties getParagraphStyle(int x)