Skip to content

Commit

Permalink
fix GetNode bug (#136)
Browse files Browse the repository at this point in the history
  • Loading branch information
JunNishimura committed Jun 23, 2023
1 parent a582d96 commit 3a35773
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion internal/object/tree.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,11 @@ func GetNode(children []*Node, path string) (*Node, bool) {
if len(node.Children) == 0 {
return node, true
}
return GetNode(node.Children, pathSplit[1])
if len(pathSplit) > 1 {
return GetNode(node.Children, pathSplit[1])
} else {
return node, true
}
} else if node.Name < searchName {
left = middle + 1
} else {
Expand Down

0 comments on commit 3a35773

Please sign in to comment.