diff --git a/api-test/backend/src/main/java/io/metersphere/api/dto/definition/request/MsScenario.java b/api-test/backend/src/main/java/io/metersphere/api/dto/definition/request/MsScenario.java index fdcd73acff..5696e2f070 100644 --- a/api-test/backend/src/main/java/io/metersphere/api/dto/definition/request/MsScenario.java +++ b/api-test/backend/src/main/java/io/metersphere/api/dto/definition/request/MsScenario.java @@ -277,7 +277,7 @@ public class MsScenario extends MsTestElement { String environmentGroupId = scenario.getEnvironmentGroupId(); if (StringUtils.equals(environmentType, EnvironmentType.GROUP.name())) { this.environmentMap = environmentGroupProjectService.getEnvMap(environmentGroupId); - } else if (StringUtils.equals(environmentType, EnvironmentType.JSON.name())) { + } else if (StringUtils.isNotEmpty(environmentJson) && StringUtils.equals(environmentType, EnvironmentType.JSON.name())) { this.environmentMap = JSON.parseObject(environmentJson, Map.class); } } else { diff --git a/framework/sdk-parent/sdk/src/main/java/io/metersphere/base/mapper/ext/BaseTaskMapper.xml b/framework/sdk-parent/sdk/src/main/java/io/metersphere/base/mapper/ext/BaseTaskMapper.xml index 265538de8f..5f0d2071a2 100644 --- a/framework/sdk-parent/sdk/src/main/java/io/metersphere/base/mapper/ext/BaseTaskMapper.xml +++ b/framework/sdk-parent/sdk/src/main/java/io/metersphere/base/mapper/ext/BaseTaskMapper.xml @@ -40,7 +40,7 @@ AND t.user_id = #{request.executor} AND (t.integrated_report_id IS NULL OR t.integrated_report_id = 'null') - ORDER BY t.create_time,t.end_time DESC + ORDER BY t.create_time DESC