Bug 64044 - NPE when passing null to setCellValue as LocalDate type in CellBase
Summary: NPE when passing null to setCellValue as LocalDate type in CellBase
Alias: None
Product: POI
Classification: Unclassified
Component: SS Common (show other bugs)
Version: 4.1.1-FINAL
Hardware: PC All
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
Depends on:
Reported: 2020-01-02 10:59 UTC by Michał Jaszczyk
Modified: 2020-01-06 21:30 UTC (History)
0 users


Note You need to log in before you can comment on or make changes to this bug.
Description Michał Jaszczyk 2020-01-02 10:59:40 UTC
If passing null to any setCellValue method for CellBase it would set cell type to blank.
There is only one exception, when passing null as LocalDate type due to default implementation in Cell interface which tries to convert LocalDate to LocalDateTime by invoking atStartOfDay method on given LocalDate.

To be consistent, the default implementation should be removed and CellBase would need to check for null as in other implementations of setCellValue method
Comment 1 PJ Fanning 2020-01-02 14:55:11 UTC
Thanks for reporting this. I'm putting together a fix.

For the time being, users will need to workaround this bug by using cell.setCellValue((String)null) or something similar.
Comment 3 Kevin Seymour 2020-01-06 21:30:43 UTC
Would it be possible to push this into 4.1.2?  I don't see it scheduled for any release yet.