From 1b17dedc478ed40e3e564118f45dcf530c73290e Mon Sep 17 00:00:00 2001 From: kolaente Date: Wed, 15 Nov 2023 12:05:29 +0100 Subject: [PATCH] fix: don't crash when encountering a container with empty env variables Resolves https://kolaente.dev/konrad/docker-db-backup/issues/4 --- helper.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/helper.go b/helper.go index 173e550..abe71aa 100644 --- a/helper.go +++ b/helper.go @@ -7,6 +7,9 @@ func parseEnv(envs []string) map[string]string { for _, s := range envs { parts := strings.SplitN(s, "=", 2) + if len(parts) < 2 { + continue + } env[parts[0]] = parts[1] }