]> source.dussan.org Git - poi.git/commitdiff
prevent index out of range exception
authorSergey Vladimirov <sergey@apache.org>
Fri, 15 Jul 2011 12:45:24 +0000 (12:45 +0000)
committerSergey Vladimirov <sergey@apache.org>
Fri, 15 Jul 2011 12:45:24 +0000 (12:45 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1147126 13f79535-47bb-0310-9956-ffa450edef68

src/scratchpad/src/org/apache/poi/hwpf/converter/AbstractWordConverter.java

index 5a6221e8bd699be88f03f98c6dfaf2659256693a..e5fd7382cce58cb9c3101978a5c22256feb9deb9 100644 (file)
@@ -119,8 +119,8 @@ public abstract class AbstractWordConverter
                                 currentTableLevel, aliveField, block );
 
                         int continueAfter = aliveField.getEndOffset();
-                        while ( range.getCharacterRun( c ).getEndOffset() <= continueAfter
-                                && c < range.numCharacterRuns() )
+                        while ( c < range.numCharacterRuns()
+                                && range.getCharacterRun( c ).getEndOffset() <= continueAfter )
                             c++;
 
                         if ( c < range.numCharacterRuns() )