From d7d277f9b653db5fa5eddeb38fbeda1318ba5b0d Mon Sep 17 00:00:00 2001 From: kolaente Date: Thu, 22 May 2025 17:06:20 +0200 Subject: [PATCH] fix(config): do not attempt to parse config values from env when they contain an invalid data type Related https://github.com/go-vikunja/vikunja/issues/719 --- pkg/config/config.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pkg/config/config.go b/pkg/config/config.go index a8173f1eb..2d9ca4f91 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -512,7 +512,13 @@ func setConfigFromEnv() error { } // Move into the nested map - currentMap = currentMap[part].(map[string]any) + typed, is := currentMap[part].(map[string]any) + if !is { + log.Errorf("Failed to set config value from environment variable %s: %s, failed on part %s, type is not map, is %t", key, value, part, currentMap[part]) + continue + } + + currentMap = typed } } }