fix NPE in TreeUtil getNode

This commit is contained in:
zpzhaoa 2020-05-06 17:08:23 +08:00
parent 7480d710cb
commit 5b3f989f7f

View File

@ -134,6 +134,11 @@ public class TreeUtil {
return node;
}
//fix NPE
if(null == node.getChildren()) {
return null;
}
// 查找子节点
Tree<T> childNode;
for (Tree<T> child : node.getChildren()) {