Skip to content

Commit

Permalink
Add error when datamap is nil
Browse files Browse the repository at this point in the history
  • Loading branch information
runewake2 committed Jun 18, 2021
1 parent b01da61 commit 1801d33
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions kyaml/yaml/rnode.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 1801d33

Please sign in to comment.