Skip to content

Commit e58aeb7

Browse files
committed
Ensuring tests pass with updated code.
Signed-off-by: quobix <dave@quobix.com>
1 parent fcc12cb commit e58aeb7

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

index/extract_refs.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -329,11 +329,12 @@ func (index *SpecIndex) ExtractRefs(node, parent *yaml.Node, seenPath []string,
329329
// capture enums
330330
if n.Value == "enum" {
331331

332-
lastItem := seenPath[len(seenPath)-1]
333-
if lastItem == "properties" {
334-
continue
332+
if len(seenPath) > 0 {
333+
lastItem := seenPath[len(seenPath)-1]
334+
if lastItem == "properties" {
335+
continue
336+
}
335337
}
336-
337338
// all enums need to have a type, extract the type from the node where the enum was found.
338339
_, enumKeyValueNode := utils.FindKeyNodeTop("type", node.Content)
339340

0 commit comments

Comments
 (0)