Skip to content

Commit

Permalink
fix: check validity of id.Obj pointer before dereference (#22)
Browse files Browse the repository at this point in the history
  • Loading branch information
trixnz authored Jun 19, 2024
1 parent 1288474 commit 93b73ef
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion spancheck.go
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ func usesCall(
// Selector (End, SetStatus, RecordError) hit.
if n.Sel.Name == selName {
id, ok := n.X.(*ast.Ident)
found = ok && id.Obj.Decl == sv.id.Obj.Decl
found = ok && id.Obj != nil && id.Obj.Decl == sv.id.Obj.Decl
}

// Check if an ignore signature matches.
Expand Down

0 comments on commit 93b73ef

Please sign in to comment.