Skip to content

Commit

Permalink
🐛 Fix npe
Browse files Browse the repository at this point in the history
  • Loading branch information
88250 committed Mar 18, 2024
1 parent 21b64d3 commit dc95dc3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/model/blockinfo.go
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ func GetBlockIndex(id string) (ret int) {
}

rootChild := node
for ; nil == rootChild.Parent || ast.NodeDocument != rootChild.Parent.Type; rootChild = rootChild.Parent {
for ; nil != rootChild.Parent && ast.NodeDocument != rootChild.Parent.Type; rootChild = rootChild.Parent {
}

ast.Walk(tree.Root, func(n *ast.Node, entering bool) ast.WalkStatus {
Expand Down

0 comments on commit dc95dc3

Please sign in to comment.