Skip to content

Commit

Permalink
Fixed bug in nil flags
Browse files Browse the repository at this point in the history
  • Loading branch information
memclutter committed Jan 8, 2022
1 parent fdb482b commit 23ab82f
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions pkg/corecli/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,13 @@ func GenerateCommands(i interface{}) (cli.Commands, error) {

command.Before = func(c *cli.Context) error {
// Default initialization
if err := LoadFlags(flagsFieldValueOf, c); err != nil {
return err
} else if err := LoadDependencies(elValueOf, c); err != nil {
if !flagsFieldValueOf.IsZero() && !flagsFieldValueOf.IsNil() && flagsFieldValueOf.IsValid() {
if err := LoadFlags(flagsFieldValueOf, c); err != nil {
return err
}
}

if err := LoadDependencies(elValueOf, c); err != nil {
return err
}

Expand Down

0 comments on commit 23ab82f

Please sign in to comment.