From adf068cf4e190d924aa8773af5706a1e524565bf Mon Sep 17 00:00:00 2001 From: malcolmholmes <42545407+malcolmholmes@users.noreply.github.com> Date: Mon, 18 Dec 2023 09:36:06 +0000 Subject: [PATCH] Don't panic when no overrides (#287) --- pkg/config/config.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkg/config/config.go b/pkg/config/config.go index 1f35cfaa..957d0148 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -58,8 +58,10 @@ func Import() error { contextPath := fmt.Sprintf("contexts.%s", name) ctx := viper.Sub(contextPath) overrides := viper.Sub("overrides") - for key, value := range overrides.AllSettings() { - ctx.Set(key, value) + if overrides != nil { + for key, value := range overrides.AllSettings() { + ctx.Set(key, value) + } } err := Write() return err