Skip to content

Commit

Permalink
Add missing nil check
Browse files Browse the repository at this point in the history
  • Loading branch information
5nord committed Nov 13, 2024
1 parent 9d9486b commit 9ebfed5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lint.go
Original file line number Diff line number Diff line change
Expand Up @@ -691,15 +691,15 @@ func inGlobalScope(stack []syntax.Node) bool {
}

func isPort(d *syntax.ValueDecl) bool {
return d.Kind.Kind() == syntax.PORT
return d.Kind != nil && d.Kind.Kind() == syntax.PORT
}

func isConst(d *syntax.ValueDecl) bool {
return d.Kind.Kind() == syntax.CONST
return d.Kind != nil && d.Kind.Kind() == syntax.CONST
}

func isVar(d *syntax.ValueDecl) bool {
return !isVarTemplate(d) && d.Kind.Kind() == syntax.VAR
return !isVarTemplate(d) && d.Kind != nil && d.Kind.Kind() == syntax.VAR
}

func isVarTemplate(d *syntax.ValueDecl) bool {
Expand Down

0 comments on commit 9ebfed5

Please sign in to comment.