diff --git a/backend/src/main/java/io/metersphere/api/service/ApiDefinitionExecResultService.java b/backend/src/main/java/io/metersphere/api/service/ApiDefinitionExecResultService.java index 362781a4cf..10ca968510 100644 --- a/backend/src/main/java/io/metersphere/api/service/ApiDefinitionExecResultService.java +++ b/backend/src/main/java/io/metersphere/api/service/ApiDefinitionExecResultService.java @@ -14,6 +14,7 @@ import io.metersphere.track.service.TestPlanApiCaseService; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; import javax.annotation.Resource; import java.util.List; @@ -60,6 +61,9 @@ public class ApiDefinitionExecResultService { } public void deleteByResourceIds(List ids) { + if (CollectionUtils.isEmpty(ids)) { + return; + } ApiDefinitionExecResultExample example = new ApiDefinitionExecResultExample(); example.createCriteria().andResourceIdIn(ids); apiDefinitionExecResultMapper.deleteByExample(example);