From 351ed0f569f96aff29b03925bf5154d80a164e00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Tue, 20 Jul 2021 18:23:09 +0200 Subject: [PATCH] commands: Fix panic on invalid config in "hugo mod get" and similar Fixes #8773 --- commands/commandeer.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commands/commandeer.go b/commands/commandeer.go index 457f708d6f4..bac96fa7a92 100644 --- a/commands/commandeer.go +++ b/commands/commandeer.go @@ -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