fix(场景自动化): 查看场景时报空指针异常
This commit is contained in:
parent
0073ed1307
commit
79e11e651a
|
@ -114,9 +114,13 @@ public class ApiAutomationService {
|
|||
Map<String, String> map = d.getEnvironmentMap();
|
||||
if (map != null) {
|
||||
if (map.isEmpty()) {
|
||||
List<String> ids = (List<String>) JSONPath.read(definition, "$..projectId");
|
||||
if (CollectionUtils.isNotEmpty(ids)) {
|
||||
idList.addAll(new HashSet<>(ids));
|
||||
try {
|
||||
List<String> ids = (List<String>) JSONPath.read(definition, "$..projectId");
|
||||
if (CollectionUtils.isNotEmpty(ids)) {
|
||||
idList.addAll(new HashSet<>(ids));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
LogUtil.error("JSONPath.read projectId fail.");
|
||||
}
|
||||
} else {
|
||||
Set<String> set = d.getEnvironmentMap().keySet();
|
||||
|
|
Loading…
Reference in New Issue