From 8894df906bd1145255417d9f82a106c6cfbe2b77 Mon Sep 17 00:00:00 2001 From: guoyuqi Date: Tue, 12 Jul 2022 12:06:25 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):=20?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E7=94=A8=E4=BE=8B=E5=AF=BC=E5=85=A5=E8=BF=87?= =?UTF-8?q?=E6=BB=A4=E5=AF=BC=E5=85=A5=E7=9A=84=E6=96=87=E4=BB=B6=E6=B2=A1?= =?UTF-8?q?=E6=9C=89case=E7=9A=84=E6=83=85=E5=86=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --user=郭雨琦 --- .../java/io/metersphere/api/service/ApiDefinitionService.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/backend/src/main/java/io/metersphere/api/service/ApiDefinitionService.java b/backend/src/main/java/io/metersphere/api/service/ApiDefinitionService.java index b972a353f3..af60bfa214 100644 --- a/backend/src/main/java/io/metersphere/api/service/ApiDefinitionService.java +++ b/backend/src/main/java/io/metersphere/api/service/ApiDefinitionService.java @@ -818,6 +818,9 @@ public class ApiDefinitionService { } private void importCase(ApiDefinitionWithBLOBs apiDefinition, ApiTestCaseMapper apiTestCaseMapper, List caseList) { + if (caseList == null || caseList.isEmpty()) { + return; + } for (ApiTestCaseWithBLOBs apiTestCaseWithBLOBs : caseList) { apiTestCaseWithBLOBs.setApiDefinitionId(apiDefinition.getId()); apiTestCaseWithBLOBs.setVersionId(apiDefinition.getVersionId());