From f956d04130d1a6a22458393e994d33b2d159c23f Mon Sep 17 00:00:00 2001 From: Danny Muid Date: Thu, 6 Mar 2003 21:40:35 +0000 Subject: [PATCH] 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 --- src/java/org/apache/poi/hssf/model/Sheet.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/java/org/apache/poi/hssf/model/Sheet.java b/src/java/org/apache/poi/hssf/model/Sheet.java index 555232ae6..63127a087 100644 --- a/src/java/org/apache/poi/hssf/model/Sheet.java +++ b/src/java/org/apache/poi/hssf/model/Sheet.java @@ -482,7 +482,7 @@ public class Sheet implements Model public MergeCellsRecord.MergedRegion getMergedRegionAt(int index) { //safety checks - if (index < numMergedRegions || mergedRecords.size() == 0) + if (index >= numMergedRegions || mergedRecords.size() == 0) return null; int pos = 0;