diff --git a/backend/src/main/java/io/metersphere/api/jmeter/APIBackendListenerClient.java b/backend/src/main/java/io/metersphere/api/jmeter/APIBackendListenerClient.java index 5664d8c40b..548c87f7f5 100644 --- a/backend/src/main/java/io/metersphere/api/jmeter/APIBackendListenerClient.java +++ b/backend/src/main/java/io/metersphere/api/jmeter/APIBackendListenerClient.java @@ -285,7 +285,7 @@ public class APIBackendListenerClient extends AbstractBackendListenerClient impl String executionEnvironment = apiScenario.getScenarioDefinition(); JSONObject json = JSONObject.parseObject(executionEnvironment); String name = ""; - if (json.getString("environmentMap").length() > 2) { + if (json != null && json.getString("environmentMap") != null && json.getString("environmentMap").length() > 2) { JSONObject environment = JSONObject.parseObject(json.getString("environmentMap")); String environmentId = environment.get(apiScenario.getProjectId()).toString(); name = apiAutomationService.get(environmentId).getName();