We're seing excel sheets that return getLastRowNum()=0 but do not allow reading row 0: for (int i = sheet.getFirstRowNum(); i <= sheet.getLastRowNum(); i++) HSSFRow row = getRow(sheet, i); -> NullPointerException when using getRow. Alternatively using the iterator interface this error can be avoided: for (Iterator iter = sheet.rowIterator(); iter.hasNext();) HSSFRow row = (HSSFRow) iter.next(); Expected behaviour would be getLastRowNum() returning -1 instead of 0.
I believe this issue may be related to bug 30635 but decided to open a new one as 30635 didn't get updated since 2004.
*** This bug has been marked as a duplicate of 30635 ***