mirror of
https://github.com/mikefarah/yq.git
synced 2025-03-15 16:37:46 +00:00
Fixed panic error #2211
This commit is contained in:
parent
e204677ff8
commit
5273715428
@ -264,7 +264,7 @@ func doTraverseMap(newMatches *orderedmap.OrderedMap, node *CandidateNode, wante
|
|||||||
// if we don't find a match directly on this node first.
|
// if we don't find a match directly on this node first.
|
||||||
|
|
||||||
var contents = node.Content
|
var contents = node.Content
|
||||||
for index := 0; index < len(contents); index = index + 2 {
|
for index := 0; index+1 < len(contents); index = index + 2 {
|
||||||
key := contents[index]
|
key := contents[index]
|
||||||
value := contents[index+1]
|
value := contents[index+1]
|
||||||
|
|
||||||
|
@ -35,6 +35,15 @@ steps:
|
|||||||
`
|
`
|
||||||
|
|
||||||
var traversePathOperatorScenarios = []expressionScenario{
|
var traversePathOperatorScenarios = []expressionScenario{
|
||||||
|
{
|
||||||
|
skipDoc: true,
|
||||||
|
description: "strange map with key but no value",
|
||||||
|
document: "!!null\n-",
|
||||||
|
expression: ".x",
|
||||||
|
expected: []string{
|
||||||
|
"D0, P[x], (!!null)::null\n",
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
skipDoc: true,
|
skipDoc: true,
|
||||||
description: "access merge anchors",
|
description: "access merge anchors",
|
||||||
|
Loading…
Reference in New Issue
Block a user