You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@poi.apache.org by ma...@apache.org on 2011/04/21 13:49:04 UTC

svn commit: r1095664 - /poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/model/StyleSheet.java

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: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org