From dbf3e624304897d7e9fb44c53c61058ed80a69e9 Mon Sep 17 00:00:00 2001 From: CaptainB Date: Thu, 23 Dec 2021 14:35:14 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E7=94=A8=E4=BE=8B?= =?UTF-8?q?=E8=AF=84=E5=AE=A1=E5=88=A0=E9=99=A4=E6=97=B6=E5=8F=98=E9=87=8F?= =?UTF-8?q?=E4=B8=8D=E8=83=BD=E6=AD=A3=E5=B8=B8=E8=8E=B7=E5=8F=96=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/metersphere/notice/sender/SendNoticeAspect.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/backend/src/main/java/io/metersphere/notice/sender/SendNoticeAspect.java b/backend/src/main/java/io/metersphere/notice/sender/SendNoticeAspect.java index d69a4ce34a..9e376a2d18 100644 --- a/backend/src/main/java/io/metersphere/notice/sender/SendNoticeAspect.java +++ b/backend/src/main/java/io/metersphere/notice/sender/SendNoticeAspect.java @@ -119,7 +119,9 @@ public class SendNoticeAspect { String target = sendNotice.target(); Expression titleExp = parser.parseExpression(target); Object v = titleExp.getValue(context, Object.class); - if (v != null) { + // 查询结果如果是null或者是{},不使用这个值 + String jsonObject = JSON.toJSONString(v); + if (v != null && !StringUtils.equals("{}", jsonObject)) { Map memberValues = (Map) value.get(invocationHandler); memberValues.put("source", JSON.toJSONString(v, WriteMapNullValue)); }