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,10 +503,12 @@ func IsNodeRefValue(node *yaml.Node) (bool, *yaml.Node, string) {
|
||||
for i, r := range n.Content {
|
||||
if i%2 == 0 {
|
||||
if r.Value == "$ref" {
|
||||
if i+1 < len(n.Content) {
|
||||
return true, r, n.Content[i+1].Value
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return false, nil, ""
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user