-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(survey): Check for nil PeerID before deref #1120
base: master
Are you sure you want to change the base?
Conversation
I'm unsure why the API would return a |
4f951f2
to
be146e2
Compare
be146e2
to
06a37b0
Compare
var peerID string | ||
if minerInfo.PeerId != nil { | ||
peerID = minerInfo.PeerId.String() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this would be more clear if this check were moved into getMinerAddrInfo
. If the peerID is nil that method can just return and log an error. What do you think @placer14?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, please address feedback and then merge
Check for nil
minerinfo.PeerId
before deref.fixes #1119