aboutsummaryrefslogtreecommitdiffstats
path: root/src/java
diff options
context:
space:
mode:
authorPJ Fanning <fanningpj@apache.org>2020-08-14 07:42:18 +0000
committerPJ Fanning <fanningpj@apache.org>2020-08-14 07:42:18 +0000
commit4e3008acdb1287325e93ce27de91e28d265be058 (patch)
tree6a799ecd243ec4106f4d9378cdb8e51744097cdc /src/java
parentdfdf9e6d6f470b82ad2a6b77e3059dd0df23905b (diff)
downloadpoi-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.java6
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;
}