]> source.dussan.org Git - poi.git/commitdiff
fix ArrayIndexOutOfBoundsException
authorSergey Vladimirov <sergey@apache.org>
Fri, 22 Jul 2011 14:28:54 +0000 (14:28 +0000)
committerSergey Vladimirov <sergey@apache.org>
Fri, 22 Jul 2011 14:28:54 +0000 (14:28 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1149617 13f79535-47bb-0310-9956-ffa450edef68

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

index dbb337a8f2eccc88fef133da2d1f3010840457b1..fc9ece7a51e3a261bae1255c9f0b86e31881946d 100644 (file)
@@ -132,7 +132,11 @@ public abstract class AbstractWordConverter
         TableCell upperCell = null;
         for ( int r1 = r - 1; r1 >= 0; r1-- )
         {
-            final TableCell prevCell = table.getRow( r1 ).getCell( c );
+            final TableRow row = table.getRow( r1 );
+            if ( row == null || c >= row.numCells() )
+                continue;
+
+            final TableCell prevCell = row.getCell( c );
             if ( prevCell != null && prevCell.isFirstVerticallyMerged() )
             {
                 upperCell = prevCell;