Skip to content

Commit

Permalink
hotfix: fix panic multiply assign (#1257)
Browse files Browse the repository at this point in the history
  • Loading branch information
care0717 authored Jun 25, 2022
1 parent b669844 commit 9b47a29
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
4 changes: 2 additions & 2 deletions pkg/yqlib/operator_assign.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
1 change: 0 additions & 1 deletion pkg/yqlib/operator_multiply.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}
Expand Down

0 comments on commit 9b47a29

Please sign in to comment.