diff --git a/backend/src/main/java/io/metersphere/api/service/ApiTestCaseService.java b/backend/src/main/java/io/metersphere/api/service/ApiTestCaseService.java index 9765ae4700..eb9bef23e0 100644 --- a/backend/src/main/java/io/metersphere/api/service/ApiTestCaseService.java +++ b/backend/src/main/java/io/metersphere/api/service/ApiTestCaseService.java @@ -867,6 +867,9 @@ public class ApiTestCaseService { apiDefinitionExample.createCriteria().andApiDefinitionIdIn(ids); List caseWithBLOBs = apiTestCaseMapper.selectByExampleWithBLOBs(apiDefinitionExample); List caseIds = caseWithBLOBs.stream().map(ApiTestCaseWithBLOBs::getId).collect(Collectors.toList()); + if (CollectionUtils.isEmpty(caseIds)) { + return; + } List bloBs = extApiTestCaseMapper.unTrashCaseListByIds(caseIds); SqlSession sqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH);