diff --git a/backend/services/case-management/src/main/java/io/metersphere/functional/service/FunctionalCaseMinderService.java b/backend/services/case-management/src/main/java/io/metersphere/functional/service/FunctionalCaseMinderService.java index 5e3b0ae2af..0b2985a2f8 100644 --- a/backend/services/case-management/src/main/java/io/metersphere/functional/service/FunctionalCaseMinderService.java +++ b/backend/services/case-management/src/main/java/io/metersphere/functional/service/FunctionalCaseMinderService.java @@ -777,12 +777,12 @@ public class FunctionalCaseMinderService { private MindAdditionalNode updateNode(String userId, MindAdditionalNodeRequest mindAdditionalNodeRequest, MindAdditionalNodeMapper mindAdditionalNodeMapper) { MindAdditionalNode mindAdditionalNode = new MindAdditionalNode(); mindAdditionalNode.setId(mindAdditionalNodeRequest.getId()); - if (mindAdditionalNodeRequest.getName().length() > 255) { - mindAdditionalNodeRequest.setName(mindAdditionalNodeRequest.getName().substring(0, 249)); - } if (StringUtils.isBlank(mindAdditionalNodeRequest.getName())) { throw new MSException(Translator.get("minder_extra_node.text_node_empty")); } + if (mindAdditionalNodeRequest.getName().length() > 255) { + mindAdditionalNodeRequest.setName(mindAdditionalNodeRequest.getName().substring(0, 249)); + } mindAdditionalNode.setName(mindAdditionalNodeRequest.getName()); mindAdditionalNode.setParentId(mindAdditionalNodeRequest.getParentId()); mindAdditionalNode.setUpdateTime(System.currentTimeMillis()); @@ -795,12 +795,12 @@ public class FunctionalCaseMinderService { private MindAdditionalNode buildNode(FunctionalCaseMinderEditRequest request, String userId, MindAdditionalNodeRequest mindAdditionalNodeRequest, MindAdditionalNodeMapper additionalNodeMapper) { MindAdditionalNode mindAdditionalNode = new MindAdditionalNode(); mindAdditionalNode.setId(mindAdditionalNodeRequest.getId()); - if (mindAdditionalNodeRequest.getName().length() > 255) { - mindAdditionalNodeRequest.setName(mindAdditionalNodeRequest.getName().substring(0, 249)); - } if (StringUtils.isBlank(mindAdditionalNodeRequest.getName())) { throw new MSException(Translator.get("minder_extra_node.text_node_empty")); } + if (mindAdditionalNodeRequest.getName().length() > 255) { + mindAdditionalNodeRequest.setName(mindAdditionalNodeRequest.getName().substring(0, 249)); + } mindAdditionalNode.setName(mindAdditionalNodeRequest.getName()); mindAdditionalNode.setParentId(mindAdditionalNodeRequest.getParentId()); mindAdditionalNode.setProjectId(request.getProjectId());