diff --git a/src/documentation/content/xdocs/status.xml b/src/documentation/content/xdocs/status.xml index f8ee55fdd..ddd44109b 100644 --- a/src/documentation/content/xdocs/status.xml +++ b/src/documentation/content/xdocs/status.xml @@ -34,6 +34,7 @@ + 48544 - avoid failures in XLSX2CSV when shared string table is missing 48571 - properly close all IO streams created in OPCPackage 48572 - always copy all declared inner classes and interfaces when generating poi-ooxml-schemas Low Level record support for the ExtRst (phonetic text) part of Unicode Strings. No usermodel access to it as yet though. diff --git a/src/examples/src/org/apache/poi/xssf/eventusermodel/XLSX2CSV.java b/src/examples/src/org/apache/poi/xssf/eventusermodel/XLSX2CSV.java index 8a77e599d..93dae5dce 100644 --- a/src/examples/src/org/apache/poi/xssf/eventusermodel/XLSX2CSV.java +++ b/src/examples/src/org/apache/poi/xssf/eventusermodel/XLSX2CSV.java @@ -151,8 +151,12 @@ public class XLSX2CSV { throws IOException, SAXException, ParserConfigurationException { ArrayList parts = pkg.getPartsByContentType(XSSFRelation.SHARED_STRINGS.getContentType()); - PackagePart sstPart = parts.get(0); - readFrom(sstPart.getInputStream()); + + // Some workbooks have no shared strings table. + if (parts.size() > 0) { + PackagePart sstPart = parts.get(0); + readFrom(sstPart.getInputStream()); + } } /**