Added arg check to NumericFunction.singleOperandEvaluate().

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@893403 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Josh Micich 2009-12-23 04:40:14 +00:00
parent 8221d39585
commit 152c76c2bf
1 changed files with 3 additions and 0 deletions

View File

@ -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);