Skip to content

Commit

Permalink
Merge pull request #4214 from stack72/f-do-floatingip_panic
Browse files Browse the repository at this point in the history
provider/digitalocean: Fixing panic condition on FloatingIP droplet
  • Loading branch information
jen20 committed Dec 8, 2015
2 parents 2652fa7 + 4b5cb07 commit 53609c8
Showing 1 changed file with 4 additions and 2 deletions.
Expand Up @@ -83,8 +83,10 @@ func resourceDigitalOceanFloatingIpRead(d *schema.ResourceData, meta interface{}
}

if _, ok := d.GetOk("droplet_id"); ok {
log.Printf("[INFO] The region of the Droplet is %s", floatingIp.Droplet.Region)
d.Set("region", floatingIp.Droplet.Region.Slug)
if floatingIp.Droplet != nil {
log.Printf("[INFO] The region of the Droplet is %s", floatingIp.Droplet.Region)
d.Set("region", floatingIp.Droplet.Region.Slug)
}
} else {
d.Set("region", floatingIp.Region.Slug)
}
Expand Down

0 comments on commit 53609c8

Please sign in to comment.