diff --git a/src/main/java/com/chint/domain/aggregates/approval/ApprovalProcess.java b/src/main/java/com/chint/domain/aggregates/approval/ApprovalProcess.java index 4964687c..25dc933c 100644 --- a/src/main/java/com/chint/domain/aggregates/approval/ApprovalProcess.java +++ b/src/main/java/com/chint/domain/aggregates/approval/ApprovalProcess.java @@ -58,7 +58,8 @@ public abstract class ApprovalProcess { ApprovalRecord approvalRecord = ApprovalRecord.of(routeOrder, this); List legs = routeOrder.getLegItems() .stream() - .filter(legItem -> legItem.getLastEvent().getEventType().equals(LEG_APPROVAL_STATUS_PREPARE)) + .filter(leg -> leg.getLastEvent() != null && + leg.getLastEvent().getEventType().equals(LEG_APPROVAL_STATUS_PREPARE)) .toList(); if (legs.isEmpty()) { throw new CommandException("不存在需要审批的行程");