fix 访问最近的计划中已删除的测试计划报错
This commit is contained in:
parent
aabfd2a38d
commit
52932ed2bc
|
@ -229,6 +229,9 @@ public class TestCaseNodeService {
|
|||
|
||||
public List<TestCaseNodeDTO> getAllNodeByPlanId(String planId) {
|
||||
TestPlan testPlan = testPlanMapper.selectByPrimaryKey(planId);
|
||||
if (testPlan == null) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
return getNodeTreeByProjectId(testPlan.getProjectId());
|
||||
}
|
||||
|
||||
|
|
|
@ -134,7 +134,9 @@ public class TestCaseService {
|
|||
public List<TestCase> getTestCaseNames(QueryTestCaseRequest request) {
|
||||
if ( StringUtils.isNotBlank(request.getPlanId()) ) {
|
||||
TestPlan testPlan = testPlanMapper.selectByPrimaryKey(request.getPlanId());
|
||||
request.setProjectId(testPlan.getProjectId());
|
||||
if (testPlan != null) {
|
||||
request.setProjectId(testPlan.getProjectId());
|
||||
}
|
||||
}
|
||||
|
||||
List<TestCase> testCaseNames = extTestCaseMapper.getTestCaseNames(request);
|
||||
|
|
|
@ -91,7 +91,7 @@ public class TestPlanService {
|
|||
}
|
||||
|
||||
public TestPlan getTestPlan(String testPlanId) {
|
||||
return testPlanMapper.selectByPrimaryKey(testPlanId);
|
||||
return Optional.ofNullable(testPlanMapper.selectByPrimaryKey(testPlanId)).orElse(new TestPlan());
|
||||
}
|
||||
|
||||
public int editTestPlan(TestPlan testPlan) {
|
||||
|
|
Loading…
Reference in New Issue