]> source.dussan.org Git - poi.git/commitdiff
hwpf: IndexOutOfBoundsException in Range.findRange when list contains only nulls
authorMaxim Valyanskiy <maxcom@apache.org>
Fri, 19 Nov 2010 14:09:13 +0000 (14:09 +0000)
committerMaxim Valyanskiy <maxcom@apache.org>
Fri, 19 Nov 2010 14:09:13 +0000 (14:09 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1036850 13f79535-47bb-0310-9956-ffa450edef68

src/scratchpad/src/org/apache/poi/hwpf/usermodel/Range.java

index 45eee75e484ec1697077c2105878e9416ce1c933..74fc4357cb1ecefc59c2877312fe8821586b7d3e 100644 (file)
@@ -973,6 +973,11 @@ public class Range { // TODO -instantiable superclass
 
                while (node==null || (node.getEnd() <= start && x < rpl.size() - 1)) {
                        x++;
+
+            if (x>=rpl.size()) {
+                return new int[] {0, 0};
+            }
+
                        node = rpl.get(x);
                }