Improve empty parentId handling logic in FetchJsonTreeCommandHandler (#1140)

- Treat as root node when parentId is empty string in FetchJsonTreeCommandHandler
This commit is contained in:
李火亮 2019-11-06 13:25:24 +08:00 committed by Eric Zhao
parent a451d4bbac
commit 7c2c137f6f
1 changed files with 1 additions and 1 deletions

View File

@ -56,7 +56,7 @@ public class ResourceTreeNode {
ResourceTreeNode node = fromNodeVo(vo);
map.put(node.id, node);
// real root
if (node.parentId == null) {
if (node.parentId == null || node.parentId.isEmpty()) {
root = node;
} else if (map.containsKey(node.parentId)) {
map.get(node.parentId).children.add(node);