Skip to content

Fix panic on empty maintenance window #1507

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

Merged
merged 2 commits into from
May 22, 2018

Conversation

emilymye
Copy link
Contributor

Fixes #1267.

Error happens if maintenance window is given but empty.

@emilymye emilymye requested review from danawillow and rosbo May 18, 2018 17:39
windows := v.([]interface{})
if len(windows) > 0 && windows[0] != nil {
settings.MaintenanceWindow = &sqladmin.MaintenanceWindow{}
window := v.([]interface{})[0].(map[string]interface{})
Copy link
Contributor

Choose a reason for hiding this comment

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

This can be window := windows[0].(map[string]interface{})

@danawillow danawillow merged commit acaf767 into hashicorp:master May 22, 2018
@emilymye emilymye deleted the cloudsql_maintenance_window branch June 19, 2018 17:48
@ghost
Copy link

ghost commented Nov 18, 2018

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks!

@ghost ghost locked and limited conversation to collaborators Nov 18, 2018
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.

3 participants