fix(缺陷管理): 消息通知空指针异常

--bug=1022158 --user=李玉号 [ 缺陷管理]ldap用户创建jira 缺陷 后台日志报错(两个环境错误日志不一样)
https://www.tapd.cn/55049933/s/1330446
This commit is contained in:
shiziyuan9527 2023-02-02 14:53:38 +08:00 committed by lyh
parent 51e60e70ef
commit 09aad8e0e2
1 changed files with 6 additions and 0 deletions

View File

@ -99,6 +99,9 @@ public abstract class AbstractNoticeSender implements NoticeSender {
Map jsonObject = new BeanMap(o); Map jsonObject = new BeanMap(o);
String id = (String) jsonObject.get("id"); String id = (String) jsonObject.get("id");
CustomField customField = baseCustomFieldService.get(id); CustomField customField = baseCustomFieldService.get(id);
if (customField == null) {
continue;
}
Object value = jsonObject.get("value"); Object value = jsonObject.get("value");
if (value instanceof String && StringUtils.isNotEmpty((String) value)) { if (value instanceof String && StringUtils.isNotEmpty((String) value)) {
String v = StringUtils.unwrap((String) value, "\""); String v = StringUtils.unwrap((String) value, "\"");
@ -143,6 +146,9 @@ public abstract class AbstractNoticeSender implements NoticeSender {
} }
protected List<UserDetail> getUserDetails(List<String> userIds) { protected List<UserDetail> getUserDetails(List<String> userIds) {
if (CollectionUtils.isEmpty(userIds)) {
return new ArrayList<>();
}
return baseUserMapper.queryTypeByIds(userIds); return baseUserMapper.queryTypeByIds(userIds);
} }