Skip to content
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

Avoid panicking on errors without response object #34

Merged
merged 1 commit into from
May 29, 2018
Merged

Avoid panicking on errors without response object #34

merged 1 commit into from
May 29, 2018

Conversation

nussjustin
Copy link
Contributor

In some cases when an action fails the controller looks at the response status code to determine if the error can be ignored.

The problem is that for some error cases the response itself can be nil which then leads to a panic when accessing the StatusCode field.

I took a quick look at the code and found 3 places where this could happen. This PR updates the code to check for a non-nil response first in all 3 places, avoiding the panic.

Updates #33

@fatih fatih merged commit 2de03d7 into digitalocean:master May 29, 2018
@fatih
Copy link
Contributor

fatih commented May 29, 2018

Thanks @nussjustin for the fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants