From 1801d332875c9fbb0204df30e45b9b22f142d4f0 Mon Sep 17 00:00:00 2001 From: Sam Wronski Date: Fri, 18 Jun 2021 10:14:17 -0700 Subject: [PATCH] Add error when datamap is nil --- kyaml/yaml/rnode.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kyaml/yaml/rnode.go b/kyaml/yaml/rnode.go index 021133ba5a..e0678a7eb5 100644 --- a/kyaml/yaml/rnode.go +++ b/kyaml/yaml/rnode.go @@ -555,6 +555,9 @@ func (rn *RNode) GetValidatedDataMap(expectedKeys []string) (map[string]string, } func (rn *RNode) validateDataMap(dataMap map[string]string, expectedKeys []string) error { + if dataMap == nil { + return fmt.Errorf("The datamap is unassigned") + } for key := range dataMap { found := false for _, expected := range expectedKeys {