diff --git a/backend/src/main/java/io/metersphere/track/service/TestCaseService.java b/backend/src/main/java/io/metersphere/track/service/TestCaseService.java index 3e49cdf5e1..e424744081 100644 --- a/backend/src/main/java/io/metersphere/track/service/TestCaseService.java +++ b/backend/src/main/java/io/metersphere/track/service/TestCaseService.java @@ -238,8 +238,10 @@ public class TestCaseService { testCaseMapper.insert(request); saveFollows(request.getId(), request.getFollows()); List addFields = request.getAddFields(); - addFields.addAll(request.getEditFields()); - customFieldTestCaseService.addFields(request.getId(), addFields); + if (CollectionUtils.isNotEmpty(addFields)) { + addFields.addAll(request.getEditFields()); + customFieldTestCaseService.addFields(request.getId(), addFields); + } return request; }