DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUGĀ·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=44456>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED ANDĀ·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=44456





------- Additional Comments From [EMAIL PROTECTED]  2008-02-20 11:54 -------
HSSFSheet.getRow(int) may return null if the row is missing.  This call 
appears to be on line 76 in the latest version.  I can't find a good 
explanation for why your stacktrace says line 77.  If the NPE is really coming 
from 'd.height' (on line 77), then please ignore this posting.

This is the current code:
      Dimension d = getPreferredSize();
      int rowHeight = (int)sheet.getRow(index).getHeightInPoints();
      d.height = rowHeight+extraHeight;

I would propose this fix:
      Dimension d = getPreferredSize();
      HSSFRow row = sheet.getRow(index);
      int rowHeight;
      if(row == null) {
          rowHeight = (int)sheet.getDefaultRowHeightInPoints();
      } else {
          rowHeight = (int)row.getHeightInPoints();
      }
      d.height = rowHeight+extraHeight;


-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to