Bug 38796

Summary: NullPointerException at org.apache.poi.hssf.usermodel.HSSFSheet.isRowBroken(HSSFSheet.java:1129)
Product: POI Reporter: SV <sudha_rv>
Component: HSSFAssignee: POI Developers List <dev>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P2    
Version: 2.5-FINAL   
Target Milestone: ---   
Hardware: PC   
OS: other   

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