From e9583700069fbeba2250238d91fb79e8a28b982e Mon Sep 17 00:00:00 2001 From: fit2-zhao Date: Wed, 16 Jun 2021 15:41:50 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E5=8C=96):=20=20=E4=BF=AE=E5=A4=8D=E6=B5=8B=E8=AF=95=E7=94=A8?= =?UTF-8?q?=E4=BE=8B=E6=A8=A1=E5=9D=97=E5=8C=B9=E9=85=8D=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../request/sampler/MsHTTPSamplerProxy.java | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/backend/src/main/java/io/metersphere/api/dto/definition/request/sampler/MsHTTPSamplerProxy.java b/backend/src/main/java/io/metersphere/api/dto/definition/request/sampler/MsHTTPSamplerProxy.java index 706eebd7c8..0e71865b0d 100644 --- a/backend/src/main/java/io/metersphere/api/dto/definition/request/sampler/MsHTTPSamplerProxy.java +++ b/backend/src/main/java/io/metersphere/api/dto/definition/request/sampler/MsHTTPSamplerProxy.java @@ -635,12 +635,17 @@ public class MsHTTPSamplerProxy extends MsTestElement { } else { apiDefinition = apiDefinitionService.get(this.getId()); if (apiDefinition == null) { - TestPlanApiCaseService testPlanApiCaseService = CommonBeanFactory.getBean(TestPlanApiCaseService.class); - TestPlanApiCase testPlanApiCase = testPlanApiCaseService.getById(this.getId()); - if (testPlanApiCase != null) { - ApiTestCaseWithBLOBs caseWithBLOBs = apiTestCaseService.get(testPlanApiCase.getApiCaseId()); - if (caseWithBLOBs != null) { - apiDefinition = apiDefinitionService.get(caseWithBLOBs.getApiDefinitionId()); + ApiTestCaseWithBLOBs apiTestCaseWithBLOBs = apiTestCaseService.get(this.getId()); + if (apiTestCaseWithBLOBs != null) { + apiDefinition = apiDefinitionService.get(apiTestCaseWithBLOBs.getApiDefinitionId()); + } else { + TestPlanApiCaseService testPlanApiCaseService = CommonBeanFactory.getBean(TestPlanApiCaseService.class); + TestPlanApiCase testPlanApiCase = testPlanApiCaseService.getById(this.getId()); + if (testPlanApiCase != null) { + ApiTestCaseWithBLOBs caseWithBLOBs = apiTestCaseService.get(testPlanApiCase.getApiCaseId()); + if (caseWithBLOBs != null) { + apiDefinition = apiDefinitionService.get(caseWithBLOBs.getApiDefinitionId()); + } } } }