diff options
author | PJ Fanning <fanningpj@apache.org> | 2020-08-14 07:42:18 +0000 |
---|---|---|
committer | PJ Fanning <fanningpj@apache.org> | 2020-08-14 07:42:18 +0000 |
commit | 4e3008acdb1287325e93ce27de91e28d265be058 (patch) | |
tree | 6a799ecd243ec4106f4d9378cdb8e51744097cdc /src/java | |
parent | dfdf9e6d6f470b82ad2a6b77e3059dd0df23905b (diff) | |
download | poi-4e3008acdb1287325e93ce27de91e28d265be058.tar.gz poi-4e3008acdb1287325e93ce27de91e28d265be058.zip |
[github-191] Fix RuntimeException on array formula referencing blank cell. Thanks to Miłosz Rembisz. This closes #191
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1880844 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java')
-rw-r--r-- | src/java/org/apache/poi/ss/formula/WorkbookEvaluator.java | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/java/org/apache/poi/ss/formula/WorkbookEvaluator.java b/src/java/org/apache/poi/ss/formula/WorkbookEvaluator.java index 060f274ef0..77d0937876 100644 --- a/src/java/org/apache/poi/ss/formula/WorkbookEvaluator.java +++ b/src/java/org/apache/poi/ss/formula/WorkbookEvaluator.java @@ -633,6 +633,12 @@ public final class WorkbookEvaluator { else { value = dereferenceResult(evaluationResult, ec.getRowIndex(), ec.getColumnIndex()); } + if (value == BlankEval.instance) { + // Note Excel behaviour here. A blank final final value is converted to zero. + return NumberEval.ZERO; + // Formulas _never_ evaluate to blank. If a formula appears to have evaluated to + // blank, the actual value is empty string. This can be verified with ISBLANK(). + } return value; } |