kyoh86 / looppointer

An analyzer that checks for pointers to enclosing loop variables.
MIT License
38 stars 4 forks source link

fix: rare nil panic; occasionally id.Obj can be nil #5

Closed kalexmills closed 3 years ago

kalexmills commented 3 years ago

I'm not sure if this happens from the command-line, but when running the analysis from code one may encounter cases where id.Obj is nil (as documented). This may cause a runtime panic.

I suspect when id.Obj == nil we have nothing to report, which is what this PR does.

Feel free to close if you have another way to resolve.