Bug 37056 - Sheet.isGridsPrinted() generates an exception
Summary: Sheet.isGridsPrinted() generates an exception
Alias: None
Product: POI
Classification: Unclassified
Component: HSSF (show other bugs)
Version: 3.0-dev
Hardware: Other Windows XP
: P2 major (vote)
Target Milestone: ---
Assignee: POI Developers List
Depends on:
Reported: 2005-10-12 20:20 UTC by Bill Seddon
Modified: 2006-01-12 18:21 UTC (History)
0 users


Note You need to log in before you can comment on or make changes to this bug.
Description Bill Seddon 2005-10-12 20:20:52 UTC
The sheet variable gridset can be null when this function is called via 
HSSFWorksheet.isGridsPrinted().  Because there is no error detection in the 
method, an exception is generated.
Comment 1 Bill Seddon 2005-10-12 20:32:17 UTC
Adding the line:

if (gridset == null) gridset = (GridsetRecord)createGridset();

before the return statement will address the problem though I've no idea if 
this a valid thing to do.
Comment 2 Jason Height 2006-01-13 03:21:48 UTC
Sheet.gridset field was not being set when the sheet was created from an
existing workbook.

If the Sheet.isGridsPrinted is called and there is no gridset then one is created.

Fix committed in SVN.