Added a nill check to lookup.

was causing vacuum to crash during testing.
This commit is contained in:
quobix
2024-07-09 13:32:31 -04:00
parent c9155f7ef3
commit 425b25cdd0
2 changed files with 42 additions and 1 deletions

View File

@@ -336,7 +336,7 @@ func FindKeyNodeFull(key string, nodes []*yaml.Node) (keyNode *yaml.Node, labelN
}
}
if key == v.Content[x].Value {
if len(v.Content) > 0 && key == v.Content[x].Value {
if IsNodeMap(v) {
if x+1 == len(v.Content) {
return v, v.Content[x], NodeAlias(v.Content[x])