poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ser...@apache.org
Subject svn commit: r1145405 - /poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/TableRow.java
Date Tue, 12 Jul 2011 00:37:46 GMT
Author: sergey
Date: Tue Jul 12 00:37:45 2011
New Revision: 1145405

URL: http://svn.apache.org/viewvc?rev=1145405&view=rev
Log:
NPE check

Modified:
    poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/TableRow.java

Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/TableRow.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/TableRow.java?rev=1145405&r1=1145404&r2=1145405&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/TableRow.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/TableRow.java Tue Jul 12 00:37:45
2011
@@ -174,12 +174,15 @@ public final class TableRow extends Rang
             cells.add( tableCell );
         }
 
-        TableCell lastCell = cells.get( cells.size() - 1 );
-        if ( lastCell.numParagraphs() == 1
-                && ( lastCell.getParagraph( 0 ).isTableRowEnd() ) )
+        if ( !cells.isEmpty() )
         {
-            // remove "fake" cell
-            cells.remove( cells.size() - 1 );
+            TableCell lastCell = cells.get( cells.size() - 1 );
+            if ( lastCell.numParagraphs() == 1
+                    && ( lastCell.getParagraph( 0 ).isTableRowEnd() ) )
+            {
+                // remove "fake" cell
+                cells.remove( cells.size() - 1 );
+            }
         }
 
         if ( cells.size() != expectedCellsCount )



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org


Mime
View raw message