fix: prevent null ids from breaking task progress snapshot

This commit is contained in:
Your Name 2026-02-07 17:19:41 +08:00
parent 6a65a4a68a
commit ba733cd47b

View File

@ -116,7 +116,7 @@ public class TaskProgressSnapshotService {
private Map<Long, User> loadUsers(List<Task> tasks) {
Set<Long> userIds = tasks.stream()
.flatMap(task -> List.of(task.getPublisherId(), task.getReceiverId()).stream())
.flatMap(task -> java.util.stream.Stream.of(task.getPublisherId(), task.getReceiverId()))
.filter(Objects::nonNull)
.collect(Collectors.toSet());
if (CollectionUtils.isEmpty(userIds)) {
@ -128,7 +128,7 @@ public class TaskProgressSnapshotService {
private Map<Long, Department> loadDepartments(List<Task> tasks) {
Set<Long> deptIds = tasks.stream()
.flatMap(task -> List.of(task.getReceiverDeptId(), task.getPublisherDeptId()).stream())
.flatMap(task -> java.util.stream.Stream.of(task.getReceiverDeptId(), task.getPublisherDeptId()))
.filter(Objects::nonNull)
.collect(Collectors.toSet());
if (CollectionUtils.isEmpty(deptIds)) {