Author: maxcom
Date: Thu Apr 21 11:49:03 2011
New Revision: 1095664

URL: http://svn.apache.org/viewvc?rev=1095664&view=rev
Log:
hwpf: ignore invalid style reference

Modified:
    poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/model/StyleSheet.java

Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/model/StyleSheet.java
URL: 
http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/model/StyleSheet.java?rev=1095664&r1=1095663&r2=1095664&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/model/StyleSheet.java 
(original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/model/StyleSheet.java Thu 
Apr 21 11:49:03 2011
@@ -316,7 +316,12 @@ public final class StyleSheet implements
     {
       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)



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to