Skip to content

Commit

Permalink
fix: fix bug on nil invoke parenthesis
Browse files Browse the repository at this point in the history
  • Loading branch information
zhuliquan committed Apr 7, 2024
1 parent 77151ce commit 1fb32eb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ast/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ func (n *base) SetType(t reflect.Type) {

// SetParenthesis indicate node is surround by bracket
func (n *base) SetParenthesis() {
n.hasParen = true
if n != nil {
n.hasParen = true
}
}

func (n *base) parenthesis() bool {
Expand Down

0 comments on commit 1fb32eb

Please sign in to comment.