We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b626981 commit f8e3058Copy full SHA for f8e3058
command.go
@@ -53,10 +53,12 @@ func (thisRef *Command) parseAndExecute(execute bool) error {
53
54
// 2. find root and ask to parse flags
55
commandToExecute := thisRef.getLastSubcommandFlagedForExecute()
56
- if execute && helpsIsWanted {
57
- commandToExecute.showUsage()
58
- } else if execute && commandToExecute.Handler != nil {
59
- commandToExecute.Handler(commandToExecute)
+ if commandToExecute != nil {
+ if execute && helpsIsWanted {
+ commandToExecute.showUsage()
+ } else if execute && commandToExecute.Handler != nil {
60
+ commandToExecute.Handler(commandToExecute)
61
+ }
62
}
63
64
return nil
0 commit comments