From: Sergey Vladimirov Date: Fri, 22 Jul 2011 14:28:54 +0000 (+0000) Subject: fix ArrayIndexOutOfBoundsException X-Git-Tag: REL_3_8_BETA4~96 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=bffd3722a2fba8da4518e56a3f10a2f12a8bb8de;p=poi.git fix ArrayIndexOutOfBoundsException git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1149617 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/scratchpad/src/org/apache/poi/hwpf/converter/AbstractWordConverter.java b/src/scratchpad/src/org/apache/poi/hwpf/converter/AbstractWordConverter.java index dbb337a8f2..fc9ece7a51 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/converter/AbstractWordConverter.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/converter/AbstractWordConverter.java @@ -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;