Bug 66257 - NullPointerException in XSSFReader$SheetIterator.next()
Summary: NullPointerException in XSSFReader$SheetIterator.next()
Status: RESOLVED FIXED
Alias: None
Product: POI
Classification: Unclassified
Component: XSSF (show other bugs)
Version: 5.2.2-FINAL
Hardware: PC Linux
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-09-10 14:20 UTC by Tilman Hausherr
Modified: 2022-09-22 21:38 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
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