fix(sj_beta2):

1、客户端重试组件异常空指针修复
This commit is contained in:
wodeyangzipingpingwuqi 2024-05-17 16:00:40 +08:00
parent a1ed75b1d4
commit d383ed9be4

View File

@ -4,6 +4,7 @@ import com.aizuda.snailjob.common.core.constant.SystemConstants;
import com.aizuda.snailjob.server.model.dto.ConfigDTO;
import org.springframework.util.CollectionUtils;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
@ -49,9 +50,11 @@ public final class GroupVersionCache {
public static ConfigDTO.Notify getRetryNotifyAttribute(Integer notifyScene) {
List<ConfigDTO.Notify> notifyList = CONFIG.getNotifyList();
for (ConfigDTO.Notify notify : notifyList) {
if (notify.getRetryNotifyScene().equals(notifyScene)) {
return notify;
if (!CollectionUtils.isEmpty(notifyList)) {
for (ConfigDTO.Notify notify : notifyList) {
if (Objects.nonNull(notify.getRetryNotifyScene()) && notify.getRetryNotifyScene().equals(notifyScene)) {
return notify;
}
}
}
@ -61,9 +64,11 @@ public final class GroupVersionCache {
public static ConfigDTO.Notify getJobNotifyAttribute(Integer notifyScene) {
List<ConfigDTO.Notify> notifyList = CONFIG.getNotifyList();
for (ConfigDTO.Notify notify : notifyList) {
if (notify.getJobNotifyScene().equals(notifyScene)) {
return notify;
if (!CollectionUtils.isEmpty(notifyList)) {
for (ConfigDTO.Notify notify : notifyList) {
if (Objects.nonNull(notify.getJobNotifyScene()) && notify.getJobNotifyScene().equals(notifyScene)) {
return notify;
}
}
}