diff --git a/backend/src/main/java/io/metersphere/api/dto/automation/parse/MsScenarioParser.java b/backend/src/main/java/io/metersphere/api/dto/automation/parse/MsScenarioParser.java index 3181656570..2f82272546 100644 --- a/backend/src/main/java/io/metersphere/api/dto/automation/parse/MsScenarioParser.java +++ b/backend/src/main/java/io/metersphere/api/dto/automation/parse/MsScenarioParser.java @@ -97,7 +97,7 @@ public class MsScenarioParser extends MsAbstractParser { } } - if (finalNodeMap != null) { + if (finalNodeMap != null && finalNodeMap.get(item.getApiScenarioModuleId()) != null) { NodeTree node = finalNodeMap.get(item.getApiScenarioModuleId()); item.setApiScenarioModuleId(node.getNewId()); item.setModulePath(node.getPath()); diff --git a/backend/src/main/java/io/metersphere/api/dto/definition/parse/MsDefinitionParser.java b/backend/src/main/java/io/metersphere/api/dto/definition/parse/MsDefinitionParser.java index 5ca3aa2568..d27bf76a8a 100644 --- a/backend/src/main/java/io/metersphere/api/dto/definition/parse/MsDefinitionParser.java +++ b/backend/src/main/java/io/metersphere/api/dto/definition/parse/MsDefinitionParser.java @@ -106,7 +106,7 @@ public class MsDefinitionParser extends MsAbstractParser { String originId = apiDefinition.getId(); String id = UUID.randomUUID().toString(); - if (nodeMap != null) { + if (nodeMap != null && nodeMap.get(apiDefinition.getModuleId()) != null) { NodeTree nodeTree = nodeMap.get(apiDefinition.getModuleId()); apiDefinition.setModuleId(nodeTree.getNewId()); apiDefinition.setModulePath(nodeTree.getPath());