From 9aa2ac34a785786d66eea60974596e9ac6f2b9e6 Mon Sep 17 00:00:00 2001 From: Malcolm Holmes Date: Sun, 17 Dec 2023 08:11:53 +0000 Subject: [PATCH] Don't panic when no overrides --- 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 10c5cb1c..77840674 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