fix: prevent null ids from breaking task progress snapshot
This commit is contained in:
parent
6a65a4a68a
commit
ba733cd47b
@ -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)) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user