diff options
author | Nick Burch <nick@apache.org> | 2014-04-24 15:42:53 +0000 |
---|---|---|
committer | Nick Burch <nick@apache.org> | 2014-04-24 15:42:53 +0000 |
commit | 2c018cc43ae6bcd95c03621b67b568d50fa2b5e6 (patch) | |
tree | e73b2c7d2213f86566082d4cea9ba1db42ce92e7 /src/testcases/org | |
parent | ed23692537c54b982a78bd37077bc80658a6737e (diff) | |
download | poi-2c018cc43ae6bcd95c03621b67b568d50fa2b5e6.tar.gz poi-2c018cc43ae6bcd95c03621b67b568d50fa2b5e6.zip |
Fix bug #56450 - Avoid a NPE if a comment has no associated NoteRecord (but we still don't know where it belongs)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1589770 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/testcases/org')
-rw-r--r-- | src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java b/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java index 6df39bbe29..16d8e208b6 100644 --- a/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java +++ b/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java @@ -2549,4 +2549,20 @@ public final class TestBugs extends BaseTestBugzillaIssues { assertAlmostEquals(1950, s.getColumnWidth(10), fontAccuracy); assertAlmostEquals(2225, s.getColumnWidth(11), fontAccuracy); } + + @Test + public void bug56450() { + HSSFWorkbook wb = openSample("56450.xls"); + HSSFSheet sheet = wb.getSheetAt(0); + int comments = 0; + for (Row r : sheet) { + for (Cell c : r) { + if (c.getCellComment() != null) { + assertNotNull(c.getCellComment().getString().getString()); + comments++; + } + } + } + assertEquals(0, comments); + } } |