Merge pull request #4214 from stack72/f-do-floatingip_panic
provider/digitalocean: Fixing panic condition on FloatingIP droplet
This commit is contained in:
commit
53609c89c5
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue