Skip to content

Commit

Permalink
internal/typeof: fix nil pointer deref
Browse files Browse the repository at this point in the history
  • Loading branch information
quasilyte committed Aug 26, 2018
1 parent cc1e1eb commit 701d065
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/typeof/typeof.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func inferApproxType(x ast.Node) approxType {
}

func typeOfObject(obj *ast.Object) approxType {
if obj.Decl == nil {
if obj == nil || obj.Decl == nil {
return typUnknown
}
spec, ok := obj.Decl.(*ast.TypeSpec)
Expand Down

0 comments on commit 701d065

Please sign in to comment.