From 48af135835bc3128558b537bb182a18f6d39976f Mon Sep 17 00:00:00 2001 From: yuhao <754630941@qq.com> Date: Wed, 20 Nov 2024 11:33:50 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=A9=BA=E5=AD=97=E7=AC=A6?= =?UTF-8?q?=E4=B8=B2=E5=AF=BC=E8=87=B4=E8=99=9A=E6=8B=9F=E5=88=97=E8=A7=A3?= =?UTF-8?q?=E6=9E=90=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Services/RuleService.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Services/RuleService.cs b/Services/RuleService.cs index ac665b7..24fafe0 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; -- Gitee