diff --git a/hcl2template/types.kv.go b/hcl2template/types.kv.go index faf8a2a27..cd1e63007 100644 --- a/hcl2template/types.kv.go +++ b/hcl2template/types.kv.go @@ -10,6 +10,9 @@ type NameValue struct { type NameValues []NameValue func (kvs NameValues) CopyOn(to *map[string]string) []error { + if len(kvs) == 0 { + return nil + } if *to == nil { *to = map[string]string{} }