mirror of
https://github.com/mikefarah/yq.git
synced 2024-11-13 22:38:04 +00:00
Fixed npe in log #1596
This commit is contained in:
parent
08a6cb65fe
commit
360a47fddc
@ -82,10 +82,11 @@ func variableLoopSingleChild(d *dataTreeNavigator, context Context, originalExp
|
|||||||
newContext.SetVariable(variableName, variableValue)
|
newContext.SetVariable(variableName, variableValue)
|
||||||
|
|
||||||
rhs, err := d.GetMatchingNodes(newContext, originalExp.RHS)
|
rhs, err := d.GetMatchingNodes(newContext, originalExp.RHS)
|
||||||
log.Debug("PROCESSING VARIABLE DONE, got back: ", rhs.MatchingNodes.Len())
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return Context{}, err
|
return Context{}, err
|
||||||
}
|
}
|
||||||
|
log.Debug("PROCESSING VARIABLE DONE, got back: ", rhs.MatchingNodes.Len())
|
||||||
results.PushBackList(rhs.MatchingNodes)
|
results.PushBackList(rhs.MatchingNodes)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13,6 +13,12 @@ var variableOperatorScenarios = []expressionScenario{
|
|||||||
"D0, P[], (doc)::{}\n",
|
"D0, P[], (doc)::{}\n",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
skipDoc: true,
|
||||||
|
document: `{}`,
|
||||||
|
expression: `.a.b as $foo`,
|
||||||
|
expectedError: "must use variable with a pipe, e.g. `exp as $x | ...`",
|
||||||
|
},
|
||||||
{
|
{
|
||||||
document: "a: [cat]",
|
document: "a: [cat]",
|
||||||
skipDoc: true,
|
skipDoc: true,
|
||||||
|
Loading…
Reference in New Issue
Block a user