From 9b47a298645582a6582b4decf731b9014a83ed67 Mon Sep 17 00:00:00 2001 From: Hayama <31230261+care0717@users.noreply.github.com> Date: Sat, 25 Jun 2022 11:08:52 +0900 Subject: [PATCH] hotfix: fix panic multiply assign (#1257) --- pkg/yqlib/operator_assign.go | 4 ++-- pkg/yqlib/operator_multiply.go | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) 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)) }