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 fa87b42774
commit 00261fa76a
1 changed files with 6 additions and 1 deletions

View File

@ -316,7 +316,12 @@ public final class StyleSheet implements HDFType {
{
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)