Fix panic in digital_ocean_droplet if resp is nil

Fixes #5583.
This commit is contained in:
James Nugent 2016-03-11 16:00:13 +00:00
parent 01b3e215d7
commit d9d8208a91
1 changed files with 1 additions and 1 deletions

View File

@ -189,7 +189,7 @@ func resourceDigitalOceanDropletRead(d *schema.ResourceData, meta interface{}) e
droplet, resp, err := client.Droplets.Get(id)
if err != nil {
// check if the droplet no longer exists.
if resp.StatusCode == 404 {
if resp != nil && resp.StatusCode == 404 {
log.Printf("[WARN] DigitalOcean Droplet (%s) not found", d.Id())
d.SetId("")
return nil