From 21e9b8d7968a67d66076dedb31bc8e3925189328 Mon Sep 17 00:00:00 2001 From: chenjianxing Date: Fri, 29 Jul 2022 10:34:35 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=B5=8B=E8=AF=95=E8=B7=9F=E8=B8=AA):=20?= =?UTF-8?q?=E8=84=91=E5=9B=BE=E5=88=9B=E5=BB=BA=E7=94=A8=E4=BE=8B=E6=8A=A5?= =?UTF-8?q?=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1015526 --user=陈建星 [测试跟踪]github#16457升级到v2.0.0版本后,脑图新增用例保存报错500,后台服务日志报NullPointerException {#_orginal_url#} --- .../java/io/metersphere/track/service/TestCaseService.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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; }