aboutsummaryrefslogtreecommitdiffstats
path: root/src/ooxml/testcases
diff options
context:
space:
mode:
authorTim Allison <tallison@apache.org>2016-10-20 18:45:03 +0000
committerTim Allison <tallison@apache.org>2016-10-20 18:45:03 +0000
commit489bebba0ee749cc961ce092bb4007d7c23343d2 (patch)
treec9d04071253172a2bd72589852e3ba453f828e61 /src/ooxml/testcases
parente816f0f79faa290571b17c1140a6a393fe88e058 (diff)
downloadpoi-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.java19
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();
+ }
}