Update for more potential nils. #53

Merged
merged 1 commit into from May 2, 2016

Conversation

Projects
None yet
3 participants
Owner

howbazaar commented May 2, 2016

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)
@mjs

mjs May 2, 2016

This is a nice concise way of approaching this

mjs commented May 2, 2016

LGTM

Owner

howbazaar commented May 2, 2016

$$merge$$

Contributor

jujubot commented May 2, 2016

@jujubot jujubot merged commit 8d0fc40 into juju:master May 2, 2016

@howbazaar howbazaar deleted the howbazaar:more-nils branch May 2, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment