Skip to content
This repository was archived by the owner on Dec 26, 2025. It is now read-only.

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

Merged
kyoh86 merged 1 commit intokyoh86:mainfrom
kalexmills:nil-panic
Nov 24, 2020
Merged

fix: rare nil panic; occasionally id.Obj can be nil#5
kyoh86 merged 1 commit intokyoh86:mainfrom
kalexmills:nil-panic

Conversation

@kalexmills
Copy link
Contributor

@kalexmills kalexmills commented Nov 24, 2020

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.

Copy link
Owner

@kyoh86 kyoh86 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm, I also don't know the cases where id.Obj is nil.
I guess that it can be nil which the id points to undefined variable.
But now, I can't reproduced it.

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

It's right, I think so.
So now, I can approve this one.
Thank you for your contribution!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants