Browse Source

Improve empty parentId handling logic in FetchJsonTreeCommandHandler (#1140)

- Treat as root node when parentId is empty string in FetchJsonTreeCommandHandler
master
李火亮 Eric Zhao 5 years ago
parent
commit
7c2c137f6f
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/domain/ResourceTreeNode.java

+ 1
- 1
sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/domain/ResourceTreeNode.java 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);


Loading…
Cancel
Save