Bug 65065 - NullPointerException in org.apache.poi.xssf.usermodel.XSSFCellStyle#cloneStyleFrom
Summary: NullPointerException in org.apache.poi.xssf.usermodel.XSSFCellStyle#cloneStyl...
Status: NEW
Alias: None
Product: POI
Classification: Unclassified
Component: XSSF (show other bugs)
Version: 4.1.2-FINAL
Hardware: PC Mac OS X 10.1
: P2 major (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-01-07 12:25 UTC by liugenshui2012
Modified: 2021-01-23 13:12 UTC (History)
0 users



Attachments
the causing Excel file (17.97 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2021-01-08 02:43 UTC, liugenshui2012
Details

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