Bug 56444

Summary: NullPointerException on HSSFCell.getCellComment()
Product: POI Reporter: Lionel <lionel.joye>
Component: HSSFAssignee: POI Developers List <dev>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P2    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: All   
Attachments: Java Class and Excel file to run the bug.

Description Lionel 2014-04-22 13:28:41 UTC
Created attachment 31546 [details]
Java Class and Excel file to run the bug.

On some of my Excel files, POI throws a NulPointerException on HSSFCell.getCellComment() method.

I have made a synthetic Excel file and a sunthetic Java class, which are in the attachment, to present this bug.
Comment 1 Nick Burch 2014-04-22 15:16:52 UTC
Have you checked that the cell isn't null? Row.getCell(int) can return null if the cell has never been used or styled - use the overloaded getting with a MissingCellPolicy or check for null if you want your code to cope easily with this
Comment 2 Lionel 2014-04-22 15:48:17 UTC
Ok, I'm sorry : you're right, I didn't think the cell before the last cell could be null.

Thank you :-).

Lionel