mirror of
https://github.com/mikefarah/yq.git
synced 2024-12-19 20:19: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)
|
||||
|
||||
rhs, err := d.GetMatchingNodes(newContext, originalExp.RHS)
|
||||
log.Debug("PROCESSING VARIABLE DONE, got back: ", rhs.MatchingNodes.Len())
|
||||
|
||||
if err != nil {
|
||||
return Context{}, err
|
||||
}
|
||||
log.Debug("PROCESSING VARIABLE DONE, got back: ", rhs.MatchingNodes.Len())
|
||||
results.PushBackList(rhs.MatchingNodes)
|
||||
}
|
||||
|
||||
|
@ -13,6 +13,12 @@ var variableOperatorScenarios = []expressionScenario{
|
||||
"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]",
|
||||
skipDoc: true,
|
||||
|
Loading…
Reference in New Issue
Block a user