diff --git a/backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java b/backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java index a1398d86eb..517e9ae764 100644 --- a/backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java +++ b/backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java @@ -114,9 +114,13 @@ public class ApiAutomationService { Map map = d.getEnvironmentMap(); if (map != null) { if (map.isEmpty()) { - List ids = (List) JSONPath.read(definition, "$..projectId"); - if (CollectionUtils.isNotEmpty(ids)) { - idList.addAll(new HashSet<>(ids)); + try { + List ids = (List) JSONPath.read(definition, "$..projectId"); + if (CollectionUtils.isNotEmpty(ids)) { + idList.addAll(new HashSet<>(ids)); + } + } catch (Exception e) { + LogUtil.error("JSONPath.read projectId fail."); } } else { Set set = d.getEnvironmentMap().keySet();