diff options
author | Tim Allison <tallison@apache.org> | 2016-10-20 18:45:03 +0000 |
---|---|---|
committer | Tim Allison <tallison@apache.org> | 2016-10-20 18:45:03 +0000 |
commit | 489bebba0ee749cc961ce092bb4007d7c23343d2 (patch) | |
tree | c9d04071253172a2bd72589852e3ba453f828e61 /src/ooxml/testcases | |
parent | e816f0f79faa290571b17c1140a6a393fe88e058 (diff) | |
download | poi-489bebba0ee749cc961ce092bb4007d7c23343d2.tar.gz poi-489bebba0ee749cc961ce092bb4007d7c23343d2.zip |
BUG-60285 avoid NPE if missing relationship id
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1765861 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/ooxml/testcases')
-rw-r--r-- | src/ooxml/testcases/org/apache/poi/xssf/eventusermodel/TestXSSFReader.java | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/ooxml/testcases/org/apache/poi/xssf/eventusermodel/TestXSSFReader.java b/src/ooxml/testcases/org/apache/poi/xssf/eventusermodel/TestXSSFReader.java index e31254b641..49742dc9d9 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/eventusermodel/TestXSSFReader.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/eventusermodel/TestXSSFReader.java @@ -246,4 +246,23 @@ public final class TestXSSFReader extends TestCase { pkg.close(); } + + /** + * NPE when sheet has no relationship id in the workbook + * 60825 + */ + public void testSheetWithNoRelationshipId() throws Exception { + OPCPackage pkg = XSSFTestDataSamples.openSamplePackage("60825.xlsx"); + ReadOnlySharedStringsTable strings = new ReadOnlySharedStringsTable(pkg); + assertNotNull(strings); + XSSFReader reader = new XSSFReader(pkg); + StylesTable styles = reader.getStylesTable(); + assertNotNull(styles); + + XSSFReader.SheetIterator iter = (XSSFReader.SheetIterator) reader.getSheetsData(); + assertNotNull(iter.next()); + assertFalse(iter.hasNext()); + + pkg.close(); + } } |