fix(接口测试): 修复 backend listener null 判断

This commit is contained in:
Captain.B 2021-05-12 10:15:54 +08:00 committed by 刘瑞斌
parent d4a55d124f
commit 9c013c0039
1 changed files with 1 additions and 1 deletions

View File

@ -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();