diff --git a/backend/src/main/java/io/dataease/service/dataset/DataSetGroupService.java b/backend/src/main/java/io/dataease/service/dataset/DataSetGroupService.java index 9de794919f..4b84680302 100644 --- a/backend/src/main/java/io/dataease/service/dataset/DataSetGroupService.java +++ b/backend/src/main/java/io/dataease/service/dataset/DataSetGroupService.java @@ -139,10 +139,12 @@ public class DataSetGroupService { } public void getParent(List list, DatasetGroup datasetGroup) { - if (StringUtils.isNotEmpty(datasetGroup.getPid())) { - DatasetGroup d = datasetGroupMapper.selectByPrimaryKey(datasetGroup.getPid()); - list.add(d); - getParent(list, d); + if (ObjectUtils.isNotEmpty(datasetGroup)) { + if (StringUtils.isNotEmpty(datasetGroup.getPid())) { + DatasetGroup d = datasetGroupMapper.selectByPrimaryKey(datasetGroup.getPid()); + list.add(d); + getParent(list, d); + } } } }