diff --git a/backend/src/main/java/io/metersphere/api/dto/definition/parse/HarParser.java b/backend/src/main/java/io/metersphere/api/dto/definition/parse/HarParser.java index a9f545265c..d5071f5ce4 100644 --- a/backend/src/main/java/io/metersphere/api/dto/definition/parse/HarParser.java +++ b/backend/src/main/java/io/metersphere/api/dto/definition/parse/HarParser.java @@ -78,6 +78,7 @@ public class HarParser extends HarAbstractParser { url = url.split("\\?")[0]; } } catch (Exception e) { + LogUtil.error(e.getMessage(), e); } //默认取路径的最后一块 diff --git a/backend/src/main/java/io/metersphere/api/dto/definition/parse/PostmanDefinitionParser.java b/backend/src/main/java/io/metersphere/api/dto/definition/parse/PostmanDefinitionParser.java index 051e792850..4cc4489db2 100644 --- a/backend/src/main/java/io/metersphere/api/dto/definition/parse/PostmanDefinitionParser.java +++ b/backend/src/main/java/io/metersphere/api/dto/definition/parse/PostmanDefinitionParser.java @@ -73,14 +73,12 @@ public class PostmanDefinitionParser extends PostmanAbstractParserParser { if (apiDefinitionWithBLOBs != null) { String modulePath = apiDefinitionWithBLOBs.getModulePath(); List moduleDatas = moduleOptionData.get(modulePath); - if (moduleDatas != null) { - if (moduleDatas.size() <= 1) { - moduleMap.remove(modulePath); - removeModulePath(moduleMap, moduleOptionData, modulePath); - } + if (moduleDatas != null && moduleDatas.size() <= 1) { + moduleMap.remove(modulePath); + removeModulePath(moduleMap, moduleOptionData, modulePath); moduleDatas.remove(apiDefinitionWithBLOBs); } optionData.remove(apiDefinitionWithBLOBs); @@ -980,11 +978,9 @@ public class ApiModuleService extends NodeTreeService { if (apiDefinitionWithBLOBs != null) { String modulePath = apiDefinitionWithBLOBs.getModulePath(); List moduleDatas = moduleOptionData.get(modulePath); - if (moduleDatas != null) { - if (moduleDatas.size() <= 1) { - moduleMap.remove(modulePath); - removeModulePath(moduleMap, moduleOptionData, modulePath); - } + if (moduleDatas != null && moduleDatas.size() <= 1) { + moduleMap.remove(modulePath); + removeModulePath(moduleMap, moduleOptionData, modulePath); moduleDatas.remove(apiDefinitionWithBLOBs); } diff --git a/backend/src/main/java/io/metersphere/api/service/ApiScenarioModuleService.java b/backend/src/main/java/io/metersphere/api/service/ApiScenarioModuleService.java index ab4c1a34af..9b15059be1 100644 --- a/backend/src/main/java/io/metersphere/api/service/ApiScenarioModuleService.java +++ b/backend/src/main/java/io/metersphere/api/service/ApiScenarioModuleService.java @@ -603,13 +603,10 @@ public class ApiScenarioModuleService extends NodeTreeService moduleDatas = moduleOptionData.get(modulePath); - if (moduleDatas != null) { - if (moduleDatas.size() <= 1) { - moduleMap.remove(modulePath); - removeModulePath(moduleMap, moduleOptionData, modulePath); - } + if (moduleDatas != null && moduleDatas.size() <= 1) { + moduleMap.remove(modulePath); + removeModulePath(moduleMap, moduleOptionData, modulePath); moduleDatas.remove(apiScenarioWithBLOBs); - } optionData.remove(apiScenarioWithBLOBs); }