From fc4f60a2f5198a0e4b8bcbf67d1f5dc019d5d122 Mon Sep 17 00:00:00 2001 From: Matt Loberg Date: Tue, 31 Jan 2023 07:48:11 -0600 Subject: [PATCH] fix(consul): skip empty consul keys Sometimes it was picking up the top level as a keypair and causing an empty key to be inserted into the environment. Check the keypair has a value before adding it to the environment --- consul.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/consul.go b/consul.go index 6f3c227..66bda13 100644 --- a/consul.go +++ b/consul.go @@ -34,6 +34,9 @@ func (c *Consul) Load(path string) (Dict, error) { } for _, p := range pairs { + if p.Value == nil { + continue + } kv[consulKey(p.Key)] = string(p.Value) }