diff --git a/backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java b/backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java index 26da7f7ef7..d1d31f5e4e 100644 --- a/backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java +++ b/backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java @@ -1010,6 +1010,10 @@ public class ApiAutomationService { Set projectIds = apiScenarioEnv.getProjectIds(); if (CollectionUtils.isNotEmpty(envMap.keySet())) { for (String id : projectIds) { + Project project = projectMapper.selectByPrimaryKey(id); + if (project == null) { + id = apiScenarioWithBLOBs.getProjectId(); + } String s = envMap.get(id); if (StringUtils.isBlank(s)) { isEnv = false;