fix(promotion): don't evaluate rule condition if conditions to evaluate is empty (#10795)

This commit is contained in:
Riqwan Thamir
2025-01-06 09:31:58 +01:00
committed by GitHub
parent 95b61bf2da
commit f7ffa3540f
3 changed files with 43 additions and 0 deletions

View File

@@ -115,6 +115,10 @@ export function evaluateRuleValueCondition(
ruleValuesToCheck = [ruleValuesToCheck]
}
if (!ruleValuesToCheck.length) {
return false
}
return ruleValuesToCheck.every((ruleValueToCheck: string) => {
if (operator === "in" || operator === "eq") {
return ruleValues.some((ruleValue) => ruleValue === ruleValueToCheck)