From 3be804f3dadf8544488ab9afa408ce82a5839a74 Mon Sep 17 00:00:00 2001 From: Brad Rydzewski Date: Tue, 5 Mar 2019 23:42:48 -0800 Subject: [PATCH] ignore nil settings --- yaml/compiler/step.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/yaml/compiler/step.go b/yaml/compiler/step.go index a6a5a0f..8ae5bb1 100644 --- a/yaml/compiler/step.go +++ b/yaml/compiler/step.go @@ -86,6 +86,10 @@ func createStep(spec *engine.Spec, src *yaml.Container) *engine.Step { // appends the environment variables to the // container definition. for key, value := range src.Environment { + // fix https://github.com/drone/drone-yaml/issues/13 + if value == nil { + continue + } if value.Secret != "" { sec := &engine.SecretVar{ Name: value.Secret, @@ -100,6 +104,10 @@ func createStep(spec *engine.Spec, src *yaml.Container) *engine.Step { // appends the settings variables to the // container definition. for key, value := range src.Settings { + // fix https://github.com/drone/drone-yaml/issues/13 + if value == nil { + continue + } // all settings are passed to the plugin env // variables, prefixed with PLUGIN_ key = "PLUGIN_" + strings.ToUpper(key)