poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 29206] New: - NPE on HSSFSheet.getRow for blank rows
Date Tue, 25 May 2004 16:27:47 GMT
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=29206>.
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=29206

NPE on HSSFSheet.getRow for blank rows

           Summary: NPE on HSSFSheet.getRow for blank rows
           Product: POI
           Version: 3.0-dev
          Platform: PC
        OS/Version: Other
            Status: NEW
          Severity: Major
          Priority: Other
         Component: HSSF
        AssignedTo: poi-dev@jakarta.apache.org
        ReportedBy: new_connie@hotmail.com


for(int i = 1; i < 400; i++) {
   HSSFRow row = sheet.getRow(i);  //this line fails for empty row
   HSSFCell cell = row.getCell((short)0);
   value = cell.getStringCellValue();
   System.out.println("" + i + "\t"+ value);
}

The above code breaks when it encounters a blank line. I get a null pointer
exception on the line following the last data line -
java.lang.NullPointerException
	at org.apache.poi.hssf.usermodel.HSSFRow.<init>(HSSFRow.java:123)
	at org.apache.poi.hssf.usermodel.HSSFSheet.getRow(HSSFSheet.java:311)
	at accesslog.ReadXls.main(ReadXls.java:38)
Exception in thread "main" 

I'm using the dev version of POI (I got it from the CVS on 3rd May, so its a bit
old).

cheers
Conrad

---------------------------------------------------------------------
To unsubscribe, e-mail: poi-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: poi-dev-help@jakarta.apache.org


Mime
View raw message