From c8dae0aa6cbf9fd109fe7e8fa9b548618a1edd88 Mon Sep 17 00:00:00 2001 From: Maxim Valyanskiy Date: Fri, 19 Nov 2010 14:09:13 +0000 Subject: [PATCH] hwpf: IndexOutOfBoundsException in Range.findRange when list contains only nulls 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 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/scratchpad/src/org/apache/poi/hwpf/usermodel/Range.java b/src/scratchpad/src/org/apache/poi/hwpf/usermodel/Range.java index 45eee75e48..74fc4357cb 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/usermodel/Range.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/usermodel/Range.java @@ -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); } -- 2.39.5