NPE check

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1145405 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Sergey Vladimirov 2011-07-12 00:37:45 +00:00
parent c8bb280df0
commit 169018be01

View File

@ -174,12 +174,15 @@ public final class TableRow extends Range
cells.add( tableCell ); cells.add( tableCell );
} }
TableCell lastCell = cells.get( cells.size() - 1 ); if ( !cells.isEmpty() )
if ( lastCell.numParagraphs() == 1
&& ( lastCell.getParagraph( 0 ).isTableRowEnd() ) )
{ {
// remove "fake" cell TableCell lastCell = cells.get( cells.size() - 1 );
cells.remove( cells.size() - 1 ); if ( lastCell.numParagraphs() == 1
&& ( lastCell.getParagraph( 0 ).isTableRowEnd() ) )
{
// remove "fake" cell
cells.remove( cells.size() - 1 );
}
} }
if ( cells.size() != expectedCellsCount ) if ( cells.size() != expectedCellsCount )