Fixes NullPointerException for getMergedRegionAt(index) when the index provided is valid (ie, 2 merged regions, request for index 0 would return null).

git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@353023 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Danny Mui 2003-03-06 21:40:35 +00:00
parent 01065fee5e
commit 43c981a497
1 changed files with 1 additions and 1 deletions

View File

@ -482,7 +482,7 @@ public class Sheet implements Model
public MergeCellsRecord.MergedRegion getMergedRegionAt(int index) public MergeCellsRecord.MergedRegion getMergedRegionAt(int index)
{ {
//safety checks //safety checks
if (index < numMergedRegions || mergedRecords.size() == 0) if (index >= numMergedRegions || mergedRecords.size() == 0)
return null; return null;
int pos = 0; int pos = 0;