-
Notifications
You must be signed in to change notification settings - Fork 40k
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 nil pointer in etcd tools #6938
Fix nil pointer in etcd tools #6938
Conversation
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project, in which case you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed, please reply here (e.g.
|
@@ -164,6 +164,10 @@ func (h *EtcdHelper) ExtractObjToList(key string, listObj runtime.Object) error | |||
return err | |||
} | |||
|
|||
if response == nil { |
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.
Can you put this inside if err != nil, and have if IsEtcdNotFound(err) return nil? Would be clearer.
I ran across this in #6949 and fixed it differently. I'm happy to take this change instead of mine if this way makes more sense. |
The fix i asked Derek for is slightly different and is a bit more consistent with other code. Don't care which pull fixes it though.
|
SGTM. I'll rebase once this PR is merged. |
e80fdf4
to
199011e
Compare
@smarterclayton merge it ;-) |
+1 |
Fix nil pointer in etcd tools
Fixes #6934
/cc @smarterclayton