fix(Context.Run): Don't panic on unselected root node (#484)

This commit is contained in:
Abhinav Gupta
2025-01-03 18:13:14 -08:00
committed by GitHub
parent b811e32243
commit 7ca846736c
2 changed files with 16 additions and 1 deletions
+3 -1
View File
@@ -827,7 +827,9 @@ func (c *Context) Run(binds ...any) (err error) {
if method.IsValid() {
node = selected
}
} else {
}
if node == nil {
return fmt.Errorf("no command selected")
}
}