mirror of
https://github.com/LukeHagar/libopenapi.git
synced 2025-12-06 04:20:11 +00:00
Fix panic when ref is mis-used
This commit is contained in:
@@ -503,7 +503,9 @@ func IsNodeRefValue(node *yaml.Node) (bool, *yaml.Node, string) {
|
|||||||
for i, r := range n.Content {
|
for i, r := range n.Content {
|
||||||
if i%2 == 0 {
|
if i%2 == 0 {
|
||||||
if r.Value == "$ref" {
|
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
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user