mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-05-09 23:51:34 +08:00
fix NPE in TreeUtil getNode
This commit is contained in:
parent
7480d710cb
commit
5b3f989f7f
@ -134,6 +134,11 @@ public class TreeUtil {
|
|||||||
return node;
|
return node;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//fix NPE
|
||||||
|
if(null == node.getChildren()) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
// 查找子节点
|
// 查找子节点
|
||||||
Tree<T> childNode;
|
Tree<T> childNode;
|
||||||
for (Tree<T> child : node.getChildren()) {
|
for (Tree<T> child : node.getChildren()) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user