Fix bug in formula criteria with only one condition

This commit is contained in:
Wim Velzeboer
2021-08-12 08:41:33 +01:00
parent d279ab6fc2
commit 7e9c5a7fce
2 changed files with 19 additions and 2 deletions
@@ -248,11 +248,11 @@ public virtual with sharing class fflib_Criteria
for (IFormulaEvaluator evaluator : formulaParts)
{
Boolean evaluateResult = evaluator.evaluate(record, evaluatedResultByNumber);
if (evaluateResult && (this.type == 'OR'))
if (evaluateResult && (this.type == 'OR' || this.type == null))
{
return true;
}
else if (!evaluateResult && this.type == 'AND')
else if (!evaluateResult && (this.type == 'AND' || this.type == null))
{
return false;
}