commands: Fix panic on invalid config in "hugo mod get" and similar
commands: Fix panic on invalid config in "hugo mod get" and similar

Fixes #8773

anthonyfok/hugo,gohugoio/hugo,gohugoio/hugo,anthonyfok/hugo,anthonyfok/hugo,gohugoio/hugo