Fix add op when there are not matches piped in, #2383, #2384

This commit is contained in:
Mike Farah
2025-06-12 14:48:10 +10:00
parent b15ce77cad
commit 88bfbec97b
3 changed files with 55 additions and 1 deletions
+4 -1
View File
@@ -38,8 +38,11 @@ func toNodes(candidate *CandidateNode, lhs *CandidateNode) []*CandidateNode {
func addOperator(d *dataTreeNavigator, context Context, expressionNode *ExpressionNode) (Context, error) {
log.Debugf("Add operator")
// if we don't have any matching nodes, but we were piped into (have a parent exp?) then we
// shouldn't calcWhenEmpt
calcWhenEmpty := expressionNode.Parent == nil
return crossFunction(d, context.ReadOnlyClone(), expressionNode, add, true)
return crossFunction(d, context.ReadOnlyClone(), expressionNode, add, calcWhenEmpty)
}
func add(_ *dataTreeNavigator, context Context, lhs *CandidateNode, rhs *CandidateNode) (*CandidateNode, error) {