fix: 修复空指针异常

This commit is contained in:
shiziyuan9527 2021-03-19 16:36:10 +08:00
parent 497c2c3393
commit 9b16d71bae
1 changed files with 3 additions and 1 deletions

View File

@ -115,7 +115,9 @@ public class ApiAutomationService {
if (map != null) {
if (map.isEmpty()) {
List<String> ids = (List<String>) JSONPath.read(definition, "$..projectId");
idList.addAll(new HashSet<>(ids));
if (CollectionUtils.isNotEmpty(ids)) {
idList.addAll(new HashSet<>(ids));
}
} else {
Set<String> set = d.getEnvironmentMap().keySet();
idList = new ArrayList<>(set);