diff --git a/src/java/org/apache/poi/hssf/model/Sheet.java b/src/java/org/apache/poi/hssf/model/Sheet.java index 1d8995aebd..8661686682 100644 --- a/src/java/org/apache/poi/hssf/model/Sheet.java +++ b/src/java/org/apache/poi/hssf/model/Sheet.java @@ -431,9 +431,10 @@ public class Sheet implements Model } public int getNumMergedRegions() - { - return merged.getNumAreas(); - } + { + return merged!=null ? merged.getNumAreas() : 0; + } + /** * This is basically a kludge to deal with the now obsolete Label records. If