diff --git a/Services/RuleService.cs b/Services/RuleService.cs index ac665b76c80a04cd6bdb3da456f26e7dcf171be8..24fafe089ef51697cfd2540cd1bf4b395a0a0985 100644 --- a/Services/RuleService.cs +++ b/Services/RuleService.cs @@ -40,7 +40,8 @@ namespace anydata.Services { foreach (var code in codes) { - formula = Regex.Replace(formula, $@"\b{Regex.Escape(code)}\b", data[code]?.ToString() ?? string.Empty); + var value = string.IsNullOrEmpty(data[code]?.ToString()) ? "null" : data[code].ToString(); + formula = Regex.Replace(formula, $@"\b{Regex.Escape(code)}\b", value); } return formula;