diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanFunctionalCaseService.java b/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanFunctionalCaseService.java index 1957fdc9d5..0e5d4e7ea9 100644 --- a/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanFunctionalCaseService.java +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanFunctionalCaseService.java @@ -723,6 +723,9 @@ public class TestPlanFunctionalCaseService extends TestPlanResourceService { public TestPlanCaseDetailResponse getFunctionalCaseDetail(String id, String userId) { TestPlanFunctionalCase planFunctionalCase = testPlanFunctionalCaseMapper.selectByPrimaryKey(id); + if(planFunctionalCase == null){ + throw new MSException(Translator.get("resource_not_exist")); + } String caseId = planFunctionalCase.getFunctionalCaseId(); FunctionalCaseDetailDTO functionalCaseDetail = functionalCaseService.getFunctionalCaseDetail(caseId, userId, false); String caseDetailSteps = functionalCaseDetail.getSteps(); diff --git a/frontend/src/views/test-plan/testPlan/detail/featureCase/detail/index.vue b/frontend/src/views/test-plan/testPlan/detail/featureCase/detail/index.vue index cf9324592d..5d59448c11 100644 --- a/frontend/src/views/test-plan/testPlan/detail/featureCase/detail/index.vue +++ b/frontend/src/views/test-plan/testPlan/detail/featureCase/detail/index.vue @@ -433,6 +433,7 @@ } catch (error) { // eslint-disable-next-line no-console console.log(error); + loadCaseList(); } finally { caseDetailLoading.value = false; }