mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-04-19 03:01:48 +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;
|
||||
}
|
||||
|
||||
//fix NPE
|
||||
if(null == node.getChildren()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// 查找子节点
|
||||
Tree<T> childNode;
|
||||
for (Tree<T> child : node.getChildren()) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user