mirror of
https://gitee.com/dromara/hutool.git
synced 2025-05-03 20:27:58 +08:00
!120 修复TreeUtil根据id查找子节点时的NPE问题
Merge pull request !120 from haichong01/v5-dev
This commit is contained in:
commit
2ea7bfc54b
@ -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…
Reference in New Issue
Block a user