From e4d245e5050ddcd82c9d12642fc6cf8ac0946336 Mon Sep 17 00:00:00 2001 From: fit2-zhao Date: Wed, 23 Dec 2020 19:27:19 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E5=AE=9A=E4=B9=89):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=89=A7=E8=A1=8C=E7=BC=BA=E9=99=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../io/metersphere/api/dto/definition/request/MsScenario.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/backend/src/main/java/io/metersphere/api/dto/definition/request/MsScenario.java b/backend/src/main/java/io/metersphere/api/dto/definition/request/MsScenario.java index ea31fda093..db3cbf8834 100644 --- a/backend/src/main/java/io/metersphere/api/dto/definition/request/MsScenario.java +++ b/backend/src/main/java/io/metersphere/api/dto/definition/request/MsScenario.java @@ -55,7 +55,9 @@ public class MsScenario extends MsTestElement { if (StringUtils.isNotEmpty(environmentId)) { ApiTestEnvironmentService environmentService = CommonBeanFactory.getBean(ApiTestEnvironmentService.class); ApiTestEnvironmentWithBLOBs environment = environmentService.get(environmentId); - config.setConfig(JSONObject.parseObject(environment.getConfig(), EnvironmentConfig.class)); + if (environment != null && environment.getConfig() != null) { + config.setConfig(JSONObject.parseObject(environment.getConfig(), EnvironmentConfig.class)); + } } if (CollectionUtils.isNotEmpty(this.getVariables())) { config.setVariables(this.variables);