Bug 65065

Summary: NullPointerException in org.apache.poi.xssf.usermodel.XSSFCellStyle#cloneStyleFrom
Product: POI Reporter: liugenshui2012
Component: XSSFAssignee: POI Developers List <dev>
Status: NEW ---    
Severity: major    
Priority: P2    
Version: 4.1.2-FINAL   
Target Milestone: ---   
Hardware: PC   
OS: Mac OS X 10.1   
Attachments: the causing Excel file

Description liugenshui2012 2021-01-07 12:25:25 UTC
Exception:
Exception in thread "main" java.lang.NullPointerException
	at org.apache.poi.xssf.model.StylesTable.getNumberFormatId(StylesTable.java:273)
	at org.apache.poi.xssf.model.StylesTable.putNumberFormat(StylesTable.java:295)
	at org.apache.poi.xssf.usermodel.XSSFDataFormat.getFormat(XSSFDataFormat.java:52)
	at org.apache.poi.xssf.usermodel.XSSFCellStyle.cloneStyleFrom(XSSFCellStyle.java:185)
	at com.genshui.excel.ExcelStyleTest.copyCellStyle(ExcelStyleTest.java:56)
	at com.genshui.excel.ExcelStyleTest.main(ExcelStyleTest.java:29)


it actually happened in org.apache.poi.xssf.model.StylesTable#getNumberFormatId when the map numberFormats has a null value
Comment 1 Andreas Beeker 2021-01-07 12:29:50 UTC
as usual: please attach the causing Excel file
Comment 2 liugenshui2012 2021-01-08 02:43:10 UTC
Created attachment 37693 [details]
the causing Excel file

the causing Excel file
Comment 3 liugenshui2012 2021-01-08 02:44:52 UTC
(In reply to Andreas Beeker from comment #1)
> as usual: please attach the causing Excel file

the causing Excel file see Comment 2