diff --git a/src/main/java/cn/xiaoheiban/psi/nodes/ApiRootNode.java b/src/main/java/cn/xiaoheiban/psi/nodes/ApiRootNode.java index dab52e3..4498bb2 100644 --- a/src/main/java/cn/xiaoheiban/psi/nodes/ApiRootNode.java +++ b/src/main/java/cn/xiaoheiban/psi/nodes/ApiRootNode.java @@ -39,8 +39,10 @@ public Map> getAllNode() { Map> list = ApiFile.findChildren(psi, elementTypeSet); list.forEach((iElementType, astNodes) -> { List gotList = children.get(iElementType); - gotList.addAll(astNodes); - children.put(iElementType, gotList); + if (gotList != null) { + gotList.addAll(astNodes); + children.put(iElementType, gotList); + } }); } return children;