Skip to content

Commit 93b73ef

Browse files
authored
fix: check validity of id.Obj pointer before dereference (#22)
1 parent 1288474 commit 93b73ef

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

spancheck.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ func usesCall(
389389
// Selector (End, SetStatus, RecordError) hit.
390390
if n.Sel.Name == selName {
391391
id, ok := n.X.(*ast.Ident)
392-
found = ok && id.Obj.Decl == sv.id.Obj.Decl
392+
found = ok && id.Obj != nil && id.Obj.Decl == sv.id.Obj.Decl
393393
}
394394

395395
// Check if an ignore signature matches.

0 commit comments

Comments
 (0)