Skip to content

Commit

Permalink
Switch condition and returns.
Browse files Browse the repository at this point in the history
  • Loading branch information
zanvd committed Jan 19, 2025
1 parent 9033567 commit 4d65edf
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions command.go
Original file line number Diff line number Diff line change
Expand Up @@ -500,10 +500,10 @@ func (c *Command) SuggestFunc(typedName string) string {
if parent.suggestFunc != nil {
return parent.suggestFunc
}
if parent.HasParent() {
return getParentFunc(parent.Parent())
if !parent.HasParent() {
return nil
}
return nil
return getParentFunc(parent.Parent())
}
parentFunc := getParentFunc(c.Parent())
if parentFunc != nil {
Expand Down

0 comments on commit 4d65edf

Please sign in to comment.