diff --git a/api-test/backend/src/main/java/io/metersphere/api/exec/scenario/ApiScenarioExecuteService.java b/api-test/backend/src/main/java/io/metersphere/api/exec/scenario/ApiScenarioExecuteService.java index a5f64cde79..4624067561 100644 --- a/api-test/backend/src/main/java/io/metersphere/api/exec/scenario/ApiScenarioExecuteService.java +++ b/api-test/backend/src/main/java/io/metersphere/api/exec/scenario/ApiScenarioExecuteService.java @@ -298,7 +298,8 @@ public class ApiScenarioExecuteService { Map diffEnvMap = new HashMap<>(); Map envMap = runModeConfig.getEnvMap(); planEnvMap.forEach((k,v)->{ - if (envMap.get(k)!=null){ + if (envMap != null && envMap.get(k)!=null){ + diffEnvMap.put(k,envMap.get(k)); } });