import org.apache.poi.util.IOUtils;
import org.apache.poi.xssf.XSSFTestDataSamples;
import org.apache.poi.xssf.model.CommentsTable;
+import org.apache.poi.xssf.model.StylesTable;
import org.apache.poi.xssf.usermodel.XSSFRichTextString;
import org.apache.poi.xssf.usermodel.XSSFShape;
import org.apache.poi.xssf.usermodel.XSSFSimpleShape;
assertTrue(text.indexOf("Line 3") > -1);
}
+
+ /**
+ * NPE from XSSFReader$SheetIterator.<init> on XLSX files generated by
+ * the openpyxl library
+ */
+ public void test58747() throws Exception {
+ OPCPackage pkg = XSSFTestDataSamples.openSamplePackage("58747.xlsx");
+ ReadOnlySharedStringsTable strings = new ReadOnlySharedStringsTable(pkg);
+ XSSFReader reader = new XSSFReader(pkg);
+ StylesTable styles = reader.getStylesTable();
+
+ XSSFReader.SheetIterator iter = (XSSFReader.SheetIterator) reader.getSheetsData();
+ assertEquals(true, iter.hasNext());
+ iter.next();
+
+ assertEquals(false, iter.hasNext());
+ assertEquals("Orders", iter.getSheetName());
+ }
}