Checks for successful string split on env variable

This commit is contained in:
Calum Lacroix 2017-02-08 22:39:34 +00:00 committed by GitHub
parent 967e09a3a5
commit 6d67091c8b

View File

@ -254,7 +254,7 @@ func newDockerContainerHandler(
for _, envVar := range ctnr.Config.Env { for _, envVar := range ctnr.Config.Env {
if envVar != "" { if envVar != "" {
splits := strings.SplitN(envVar, "=", 2) splits := strings.SplitN(envVar, "=", 2)
if splits[0] == exposedEnv { if len(splits) == 2 && splits[0] == exposedEnv {
handler.envs[strings.ToLower(exposedEnv)] = splits[1] handler.envs[strings.ToLower(exposedEnv)] = splits[1]
} }
} }