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 2d10335c9..5cbe03a88 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/model/StyleSheet.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/model/StyleSheet.java @@ -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)