fix: 接口导入MS格式报空指针

This commit is contained in:
chenjianxing 2021-07-21 17:38:44 +08:00 committed by jianxing
parent 1d4d99acf7
commit b22b491109
2 changed files with 2 additions and 2 deletions

View File

@ -97,7 +97,7 @@ public class MsScenarioParser extends MsAbstractParser<ScenarioImport> {
}
}
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());

View File

@ -106,7 +106,7 @@ public class MsDefinitionParser extends MsAbstractParser<ApiDefinitionImport> {
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());