Skip to content

Commit

Permalink
Fix panic in digital_ocean_droplet if resp is nil
Browse files Browse the repository at this point in the history
Fixes #5583.
  • Loading branch information
jen20 committed Mar 11, 2016
1 parent 01b3e21 commit d9d8208
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d9d8208

Please sign in to comment.