fix(消息通知): 修复发送自定义webhook的消息时空指针的问题

This commit is contained in:
CaptainB 2022-06-24 16:20:29 +08:00 committed by f2c-ci-robot[bot]
parent 0dfb89007c
commit 5f20dd00e8
1 changed files with 9 additions and 7 deletions

View File

@ -61,6 +61,7 @@ public abstract class AbstractNoticeSender implements NoticeSender {
if (noticeModel.getParamMap().containsKey("customFields")) {
String customFields = (String) noticeModel.getParamMap().get("customFields");
JSONArray array = JSON.parseArray(customFields);
if (CollectionUtils.isNotEmpty(array)) {
for (Object o : array) {
JSONObject jsonObject = JSON.parseObject(o.toString());
String name = jsonObject.getString("name");
@ -71,6 +72,7 @@ public abstract class AbstractNoticeSender implements NoticeSender {
}
}
}
}
// 处理 userIds 中包含的特殊值
noticeModel.setReceivers(getRealUserIds(messageDetail, noticeModel, messageDetail.getEvent()));