fix(场景自动化): 查看场景时报空指针异常
This commit is contained in:
parent
0073ed1307
commit
79e11e651a
|
@ -114,10 +114,14 @@ public class ApiAutomationService {
|
|||
Map<String, String> map = d.getEnvironmentMap();
|
||||
if (map != null) {
|
||||
if (map.isEmpty()) {
|
||||
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();
|
||||
idList = new ArrayList<>(set);
|
||||
|
|
Loading…
Reference in New Issue