Summary: | [PATCH] NullPointerException in Sheet#serializeIndexRecord | ||
---|---|---|---|
Product: | POI | Reporter: | Julien Aymé <julien.ayme> |
Component: | HSSF | Assignee: | POI Developers List <dev> |
Status: | RESOLVED FIXED | ||
Severity: | normal | Keywords: | PatchAvailable |
Priority: | P2 | ||
Version: | 3.0-dev | ||
Target Milestone: | --- | ||
Hardware: | Other | ||
OS: | other | ||
Attachments: |
The test case
A patch proposal for the org.apache.poi.hssf.model.Sheet class A patch proposal for the org.apache.poi.hssf.model.aggregates.RowRecordsAggregate class |
Description
Julien Aymé
2007-03-05 01:53:56 UTC
Created attachment 19662 [details]
The test case
The test case file
Created attachment 19665 [details]
A patch proposal for the org.apache.poi.hssf.model.Sheet class
I am not sure that 0 for a null cells is a good default value.
Whoops, it seems that with my patch, another NPE occurs whith the same test case, but in RowRecordsAggregate.serialize: The StackTrace java.lang.NullPointerException at org.apache.poi.hssf.record.aggregates.RowRecordsAggregate.serialize(RowRecordsAggregate.java:216) at org.apache.poi.hssf.model.Sheet.serialize(Sheet.java:719) at org.apache.poi.hssf.usermodel.HSSFWorkbook.getBytes(HSSFWorkbook.java:963) at org.apache.poi.hssf.usermodel.HSSFWorkbook.write(HSSFWorkbook.java:901) at org.apache.poi.hssf.model.MyTestSheet.test(MyTestSheet.java:16) ... Created attachment 19666 [details]
A patch proposal for the org.apache.poi.hssf.model.aggregates.RowRecordsAggregate class
I just added a check for null value.
Apparently, the binary file generated is "good", ie. I can open it without any error being thrown in Excel. Julien, patch applied. Thanks a lot for it. Regards, Yegor |