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
This commit is contained in:
kolaente 2025-05-22 17:06:20 +02:00
parent 7e8a4068df
commit d7d277f9b6
No known key found for this signature in database
GPG Key ID: F40E70337AB24C9B
1 changed files with 7 additions and 1 deletions

View File

@ -512,7 +512,13 @@ func setConfigFromEnv() error {
} }
// Move into the nested map // 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
} }
} }
} }