diff --git a/manager/src/main/java/org/apache/hertzbeat/manager/service/impl/TagServiceImpl.java b/manager/src/main/java/org/apache/hertzbeat/manager/service/impl/TagServiceImpl.java index 02ac69febf6..b0508b5d74b 100644 --- a/manager/src/main/java/org/apache/hertzbeat/manager/service/impl/TagServiceImpl.java +++ b/manager/src/main/java/org/apache/hertzbeat/manager/service/impl/TagServiceImpl.java @@ -18,9 +18,11 @@ package org.apache.hertzbeat.manager.service.impl; import jakarta.persistence.criteria.Predicate; + import java.util.ArrayList; import java.util.HashSet; import java.util.List; +import java.util.Objects; import java.util.Optional; import java.util.Set; import java.util.stream.Collectors; @@ -130,7 +132,7 @@ public List listTag(Set ids) { @Override public void deleteMonitorSystemTags(Monitor monitor) { if (CollectionUtils.isNotEmpty(monitor.getTags())) { - List tags = monitor.getTags().stream().filter(tag -> tag.getType() == (byte) 0).collect(Collectors.toList()); + List tags = monitor.getTags().stream().filter(tag -> Objects.nonNull(tag.getType()) && tag.getType() == (byte) 0).collect(Collectors.toList()); tagDao.deleteAll(tags); } }