mirror of
https://github.com/mikefarah/yq.git
synced 2024-11-12 13:48:06 +00:00
hotfix: fix panic multiply assign (#1257)
This commit is contained in:
parent
b669844ef7
commit
9b47a29864
@ -22,8 +22,8 @@ func assignUpdateOperator(d *dataTreeNavigator, context Context, expressionNode
|
|||||||
}
|
}
|
||||||
|
|
||||||
prefs := assignPreferences{}
|
prefs := assignPreferences{}
|
||||||
if expressionNode.Operation.Preferences != nil {
|
if p, ok := expressionNode.Operation.Preferences.(assignPreferences); ok {
|
||||||
prefs = expressionNode.Operation.Preferences.(assignPreferences)
|
prefs = p
|
||||||
}
|
}
|
||||||
|
|
||||||
if !expressionNode.Operation.UpdateAssign {
|
if !expressionNode.Operation.UpdateAssign {
|
||||||
|
@ -27,7 +27,6 @@ func createMultiplyOp(prefs interface{}) func(lhs *ExpressionNode, rhs *Expressi
|
|||||||
|
|
||||||
func multiplyAssignOperator(d *dataTreeNavigator, context Context, expressionNode *ExpressionNode) (Context, error) {
|
func multiplyAssignOperator(d *dataTreeNavigator, context Context, expressionNode *ExpressionNode) (Context, error) {
|
||||||
var multiplyPrefs = expressionNode.Operation.Preferences
|
var multiplyPrefs = expressionNode.Operation.Preferences
|
||||||
expressionNode.Operation.Preferences = nil
|
|
||||||
|
|
||||||
return compoundAssignFunction(d, context, expressionNode, createMultiplyOp(multiplyPrefs))
|
return compoundAssignFunction(d, context, expressionNode, createMultiplyOp(multiplyPrefs))
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user