Bug 56450

Summary: NullPointerException on HSSFCell.getCellComment()
Product: POI Reporter: Lionel <lionel.joye>
Component: HSSFAssignee: POI Developers List <dev>
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-23 17:05:27 UTC
Created attachment 31553 [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 Lionel 2014-04-23 17:07:14 UTC
Here is the StackTrace :

Exception in thread "main" java.lang.NullPointerException
	at org.apache.poi.hssf.usermodel.HSSFComment.getColumn(HSSFComment.java:170)
	at org.apache.poi.hssf.usermodel.HSSFSheet.lookForComment(HSSFSheet.java:2118)
	at org.apache.poi.hssf.usermodel.HSSFSheet.findCellComment(HSSFSheet.java:2103)
	at org.apache.poi.hssf.usermodel.HSSFCell.getCellComment(HSSFCell.java:1022)
	at org.apache.poi.hssf.usermodel.HSSFCell.getCellComment(HSSFCell.java:70)
	at poi.bugs.BugGetCellComment.main(BugGetCellComment.java:58)
Comment 2 Nick Burch 2014-04-24 15:43:57 UTC
For some reason, your comments didn't have an associated NoteRecord. In r1589770 I've fixed it to not give a NPE, but without the NoteRecord we can't associate the comment with a cell, so none of your cells are found to have comments