Skip to content

Commit

Permalink
Fix panic when ref is mis-used
Browse files Browse the repository at this point in the history
  • Loading branch information
daveshanley committed Apr 29, 2024
1 parent 6f277db commit 7e86e99
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,9 @@ func IsNodeRefValue(node *yaml.Node) (bool, *yaml.Node, string) {
for i, r := range n.Content {
if i%2 == 0 {
if r.Value == "$ref" {
return true, r, n.Content[i+1].Value
if i+1 < len(n.Content) {
return true, r, n.Content[i+1].Value
}
}
}
}
Expand Down

0 comments on commit 7e86e99

Please sign in to comment.