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

Update for more potential nils. #53

Merged
merged 1 commit into from
May 2, 2016
Merged

Conversation

howbazaar
Copy link
Contributor

Instead of the hit and miss approach we have done so far, I went through the maas source code as well as I could and looked for any of the DB fields that could be null.

I have added defaults for the possible nulls in the off chance that at some stage in the future the maas api starts omitting them.

@@ -270,15 +274,16 @@ func device_2_0(source map[string]interface{}) (*device, error) {
if err != nil {
return nil, errors.Trace(err)
}

owner, _ := valid["owner"].(string)
Copy link

Choose a reason for hiding this comment

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

This is a nice concise way of approaching this

@mjs
Copy link

mjs commented May 2, 2016

LGTM

@howbazaar
Copy link
Contributor Author

$$merge$$

@jujubot
Copy link
Contributor

jujubot commented May 2, 2016

Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju-gomaasapi

@jujubot jujubot merged commit 8d0fc40 into juju:master May 2, 2016
@howbazaar howbazaar deleted the more-nils branch May 2, 2016 03:38
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.

3 participants