update(REQ-2516) - 处理一些 NPE

This commit is contained in:
wangli 2024-06-25 11:48:31 +08:00
parent 1d1f9f240d
commit 355eed83f3

View File

@ -27,6 +27,7 @@ import java.util.Objects;
import java.util.Optional; import java.util.Optional;
import static cn.axzo.workflow.core.common.code.BpmnInstanceRespCode.PROCESS_INSTANCE_NOT_EXISTS; import static cn.axzo.workflow.core.common.code.BpmnInstanceRespCode.PROCESS_INSTANCE_NOT_EXISTS;
import static cn.axzo.workflow.core.common.code.BpmnInstanceRespCode.RUNNING_INSTANCE_ONLY_FORECAST;
/** /**
@ -123,7 +124,9 @@ public class FlowNodeForecastService implements InitializingBean {
// .includeProcessVariables() // .includeProcessVariables()
.singleResult(); .singleResult();
} }
if (Objects.isNull(instance)) {
throw new WorkflowEngineException(RUNNING_INSTANCE_ONLY_FORECAST);
}
BpmnModel bpmnModel = repositoryService.getBpmnModel(instance.getProcessDefinitionId()); BpmnModel bpmnModel = repositoryService.getBpmnModel(instance.getProcessDefinitionId());
// 保持推测出来的节点执行顺序的容器 // 保持推测出来的节点执行顺序的容器