hi,
  cell.removeCellComment() instead of cell.setComment(null) is also throw
NullPointerException ,so i find poi source code,  in
org.apache.poi.hssf.usermodel.HSSFCell ,at 1021 line,

 for (Iterator it = sheet.getRecords().iterator(); it.hasNext(); ) {
           RecordBase rec = (RecordBase) it.next();
           if (rec instanceof NoteRecord){
               NoteRecord note = (NoteRecord)rec;
               if (note.getRow() == row && note.getColumn() == column){
                   TextObjectRecord txo = (TextObjectRecord)txshapes.get(new
Integer(note.getShapeId()));
                   comment = new HSSFComment(note, txo);
                   comment.setRow(note.getRow());
                   comment.setColumn(note.getColumn());
                   comment.setAuthor(note.getAuthor());
                   comment.setVisible(note.getFlags() ==
NoteRecord.NOTE_VISIBLE);
                   comment.setString(txo.getStr); *//this line txo is null
,so i modify it to'if(txo != null)',the problem is solved but i don't know
why txo is null?maybe it is a bug?*
                   break;
               }

 

--
View this message in context: 
http://apache-poi.1045710.n5.nabble.com/poi-remove-cell-comment-throw-java-lang-NullPointerException-tp4555849p4559490.html
Sent from the POI - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to