]> source.dussan.org Git - poi.git/commitdiff
handle empty strings
authorSergey Vladimirov <sergey@apache.org>
Tue, 5 Jul 2011 11:58:50 +0000 (11:58 +0000)
committerSergey Vladimirov <sergey@apache.org>
Tue, 5 Jul 2011 11:58:50 +0000 (11:58 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1143012 13f79535-47bb-0310-9956-ffa450edef68

src/scratchpad/src/org/apache/poi/hwpf/usermodel/TableRow.java

index dd522de683e094094453c0f0a33d8425ea8a0f58..015c6141b2f76aaa4413af6676505914076cdf6a 100644 (file)
@@ -50,8 +50,8 @@ public final class TableRow
       Paragraph p = getParagraph(start);
       String s = p.text();
 
-      while (! ( (s.charAt(s.length() - 1) == TABLE_CELL_MARK) ||
-                p.isEmbeddedCellMark() && p.getTableLevel() == levelNum))
+      while (! ( s.length() > 0 && (s.charAt(s.length() - 1) == TABLE_CELL_MARK) ||
+                p.isEmbeddedCellMark() && p.getTableLevel() == levelNum) && end < endIdx)
       {
         end++;
         p = getParagraph(end);