From ff919eb0e4b25a7ba9a97ad6c8fdc64a381a96b0 Mon Sep 17 00:00:00 2001 From: Dominik Stadler Date: Sat, 16 May 2020 13:05:58 +0000 Subject: Bug 64393: Adjust relational operators to handle MissingArgEval correctly git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1877815 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/poi/ss/formula/eval/RelationalOperationEval.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/java') diff --git a/src/java/org/apache/poi/ss/formula/eval/RelationalOperationEval.java b/src/java/org/apache/poi/ss/formula/eval/RelationalOperationEval.java index f83a54de47..2a9f2e34a7 100644 --- a/src/java/org/apache/poi/ss/formula/eval/RelationalOperationEval.java +++ b/src/java/org/apache/poi/ss/formula/eval/RelationalOperationEval.java @@ -86,11 +86,11 @@ public abstract class RelationalOperationEval extends Fixed2ArgFunction implemen } private static int doCompare(ValueEval va, ValueEval vb) { - // special cases when one operand is blank - if (va == BlankEval.instance) { + // special cases when one operand is blank or missing + if (va == BlankEval.instance || va instanceof MissingArgEval) { return compareBlank(vb); } - if (vb == BlankEval.instance) { + if (vb == BlankEval.instance || vb instanceof MissingArgEval) { return -compareBlank(va); } @@ -131,7 +131,7 @@ public abstract class RelationalOperationEval extends Fixed2ArgFunction implemen } private static int compareBlank(ValueEval v) { - if (v == BlankEval.instance) { + if (v == BlankEval.instance || v instanceof MissingArgEval) { return 0; } if (v instanceof BoolEval) { -- cgit v1.2.3