Bug 38796 - NullPointerException at org.apache.poi.hssf.usermodel.HSSFSheet.isRowBroken(HSSFSheet.java:1129)
Summary: NullPointerException at org.apache.poi.hssf.usermodel.HSSFSheet.isRowBroken(H...
Status: RESOLVED FIXED
Alias: None
Product: POI
Classification: Unclassified
Component: HSSF (show other bugs)
Version: 2.5-FINAL
Hardware: PC other
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-02-27 18:09 UTC by SV
Modified: 2006-08-27 04:14 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description SV 2006-02-27 18:09:18 UTC
//Read an excel spreadsheet
POIFSFileSystem fileSystem = new POIFSFileSystem(new
FileInputStream("c:/temp/test.xls"));

HSSFWorkbook workbook	= new HSSFWorkbook(fileSystem);

HSSFSheet worksheet = workbook.createSheet("ABC");

//Create a header row

for (int i = 1; i <= 50; i++)
{
    HSSFRow row = worksheet.createRow((short) i);

    for (int j = 0; j < 10; j++)
    {
        HSSFCell cell = row.createCell((short) j);
    }

    if (worksheet.isRowBroken(i)) {
	//Create a header row in new page;
    }
}


//Error details
Line # 20 in the above code throws the following exception
java.lang.NullPointerException
	at org.apache.poi.hssf.record.PageBreakRecord.getBreak(PageBreakRecord.java:251)
	at org.apache.poi.hssf.model.Sheet.isRowBroken(Sheet.java:2644)
	at org.apache.poi.hssf.usermodel.HSSFSheet.isRowBroken(HSSFSheet.java:1129)
	at ....
Comment 1 Jason Height 2006-08-27 11:14:33 UTC
Fixed in SVN

Jason