From: Josh Micich Date: Wed, 23 Dec 2009 04:40:14 +0000 (+0000) Subject: Added arg check to NumericFunction.singleOperandEvaluate(). X-Git-Tag: REL_3_7_BETA1~189 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=152c76c2bf925a0911462045999b5e1a034d1f2d;p=poi.git Added arg check to NumericFunction.singleOperandEvaluate(). git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@893403 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/java/org/apache/poi/hssf/record/formula/functions/NumericFunction.java b/src/java/org/apache/poi/hssf/record/formula/functions/NumericFunction.java index 3d32925ae3..28aed5cc28 100644 --- a/src/java/org/apache/poi/hssf/record/formula/functions/NumericFunction.java +++ b/src/java/org/apache/poi/hssf/record/formula/functions/NumericFunction.java @@ -34,6 +34,9 @@ public abstract class NumericFunction implements Function { static final double LOG_10_TO_BASE_e = Math.log(TEN); protected static final double singleOperandEvaluate(ValueEval arg, int srcRowIndex, int srcColumnIndex) throws EvaluationException { + if (arg == null) { + throw new IllegalArgumentException("arg must not be null"); + } ValueEval ve = OperandResolver.getSingleValue(arg, srcRowIndex, srcColumnIndex); double result = OperandResolver.coerceValueToDouble(ve); checkValue(result);