diff --git a/internal/flags/helpers.go b/internal/flags/helpers.go index 2656adf0ce..d3d71e1939 100644 --- a/internal/flags/helpers.go +++ b/internal/flags/helpers.go @@ -78,9 +78,11 @@ func MigrateGlobalFlags(ctx *cli.Context) { // This iterates over all commands and wraps their action function. iterate(ctx.App.Commands, func(cmd *cli.Command) { action := cmd.Action - cmd.Action = func(ctx *cli.Context) error { - doMigrateFlags(ctx) - return action(ctx) + if action != nil { + cmd.Action = func(ctx *cli.Context) error { + doMigrateFlags(ctx) + return action(ctx) + } } }) }