Bug 66257

Summary: NullPointerException in XSSFReader$SheetIterator.next()
Product: POI Reporter: Tilman Hausherr <tilman>
Component: XSSFAssignee: POI Developers List <dev>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P2    
Version: 5.2.2-FINAL   
Target Milestone: ---   
Hardware: PC   
OS: Linux   

Description Tilman Hausherr 2022-09-10 14:20:57 UTC
"commoncrawl/CC-MAIN-2021-31/75/c0/75c0f36adec322c1460ffac4406c5df4826c14c16eb16f7057511b5bc0c66397",1,False,"617","java.lang.NullPointerException
	at org.apache.poi.xssf.eventusermodel.XSSFReader$SheetIterator.next(XSSFReader.java:352)
	at org.apache.tika.parser.microsoft.ooxml.XSSFExcelExtractorDecorator.buildXHTML(XSSFExcelExtractorDecorator.java:155)


from what I understand, the problem is here:

                PackagePart sheetPkg = sheetMap.get(sheetId);
                return sheetPkg.getInputStream();

the result of get() isn't null checked. You could throw a POIXMLException instead.

I don't have the file, but maybe Tim has it.
Comment 1 PJ Fanning 2022-09-10 14:41:05 UTC
add r1903972