cleanup for r1812470: avoid NPEs from string.isEmpty()

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1812532 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Javen O'Neal 2017-10-18 14:40:56 +00:00
parent 49add35f3b
commit 22e4bc2399
2 changed files with 3 additions and 3 deletions

View File

@ -478,7 +478,7 @@ public class ToHtml {
CellFormat cf = CellFormat.getInstance(
style.getDataFormatString());
CellFormatResult result = cf.apply(cell);
content = result.text;
content = result.text; //never null
if (content.isEmpty()) {
content = " ";
}

View File

@ -169,8 +169,8 @@ public abstract class BaseTestCellComment {
assertNotNull("Cells in the second column have comments", sheet.getCellComment(new CellAddress(rownum, 1)));
assertEquals("Yegor Kozlov", comment.getAuthor());
assertFalse("cells in the second column have not empyy notes",
comment.getString().getString().isEmpty());
assertTrue("cells in the second column should have non-empty notes",
!comment.getString().getString().isEmpty());
assertEquals(rownum, comment.getRow());
assertEquals(cell.getColumnIndex(), comment.getColumn());
}