diff --git a/pkg/yqlib/operator_assign.go b/pkg/yqlib/operator_assign.go index 1e1058ed7a..705be0fda3 100644 --- a/pkg/yqlib/operator_assign.go +++ b/pkg/yqlib/operator_assign.go @@ -22,8 +22,8 @@ func assignUpdateOperator(d *dataTreeNavigator, context Context, expressionNode } prefs := assignPreferences{} - if expressionNode.Operation.Preferences != nil { - prefs = expressionNode.Operation.Preferences.(assignPreferences) + if p, ok := expressionNode.Operation.Preferences.(assignPreferences); ok { + prefs = p } if !expressionNode.Operation.UpdateAssign { diff --git a/pkg/yqlib/operator_multiply.go b/pkg/yqlib/operator_multiply.go index e1dfcd61cd..ac27ad1fd2 100644 --- a/pkg/yqlib/operator_multiply.go +++ b/pkg/yqlib/operator_multiply.go @@ -27,7 +27,6 @@ func createMultiplyOp(prefs interface{}) func(lhs *ExpressionNode, rhs *Expressi func multiplyAssignOperator(d *dataTreeNavigator, context Context, expressionNode *ExpressionNode) (Context, error) { var multiplyPrefs = expressionNode.Operation.Preferences - expressionNode.Operation.Preferences = nil return compoundAssignFunction(d, context, expressionNode, createMultiplyOp(multiplyPrefs)) }