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 9da3974953..6ac27b6001 100644 --- a/backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java +++ b/backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java @@ -332,8 +332,10 @@ public class ApiAutomationService { public ApiScenarioDTO getApiScenario(String id) { ApiScenarioDTO apiScenarioDTO = new ApiScenarioDTO(); ApiScenarioWithBLOBs scenarioWithBLOBs = apiScenarioMapper.selectByPrimaryKey(id); - BeanUtils.copyBean(apiScenarioDTO, scenarioWithBLOBs); - setApiScenarioProjectIds(apiScenarioDTO); + if (scenarioWithBLOBs != null) { + BeanUtils.copyBean(apiScenarioDTO, scenarioWithBLOBs); + setApiScenarioProjectIds(apiScenarioDTO); + } return apiScenarioDTO; }