From 5165199c5d65896192a4635ca1828af07b4cf755 Mon Sep 17 00:00:00 2001 From: Enrico Colasante Date: Thu, 17 Aug 2023 13:09:35 +0200 Subject: [PATCH] fix: Assign null value when parser return empty string [DHIS2-13275] (#111) --- src/main/java/org/hisp/dhis/rules/RuleConditionEvaluator.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/hisp/dhis/rules/RuleConditionEvaluator.java b/src/main/java/org/hisp/dhis/rules/RuleConditionEvaluator.java index e5968eb9..b6c14d66 100644 --- a/src/main/java/org/hisp/dhis/rules/RuleConditionEvaluator.java +++ b/src/main/java/org/hisp/dhis/rules/RuleConditionEvaluator.java @@ -224,9 +224,9 @@ private RuleEffect create( @Nonnull Rule rule, RuleActionAssign ruleActionAssign = (RuleActionAssign) ruleAction; String data = process( ruleActionAssign.data(), valueMap, supplementaryData, Expression.Mode.RULE_ENGINE_ACTION); updateValueMap( ruleActionAssign.field(), RuleVariableValue.create( data, RuleValueType.TEXT ), valueMap ); - if ( StringUtils.isEmpty( data ) && StringUtils.isEmpty( ruleActionAssign.data() ) ) + if ( StringUtils.isEmpty( data ) ) { - return RuleEffect.create( rule.uid(), ruleAction, ruleActionAssign.data() ); + return RuleEffect.create( rule.uid(), ruleAction, null ); } else {