Skip to content

Commit

Permalink
commands: Fix panic on invalid config in "hugo mod get" and similar
Browse files Browse the repository at this point in the history
Fixes #8773
  • Loading branch information
bep committed Jul 20, 2021
1 parent d831d2f commit 351ed0f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion commands/commandeer.go
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ func (c *commandeer) loadConfig(mustHaveConfigFile, running bool) error {
cfgSetAndInit,
doWithConfig)

if err != nil && mustHaveConfigFile {
if err != nil {
return err
} else if mustHaveConfigFile && len(configFiles) == 0 {
return hugolib.ErrNoConfigFile
Expand Down

0 comments on commit 351ed0f

Please sign in to comment.