provider/digitalocean: Check for nil response

This applies the same fix to `digitalocean_ssh_key` as #5588 applies to
droplets. Fixes #5402. The report there gives weight to my theory that
this occurs when there are transport issues.
pull/5748/head
James Nugent 10 years ago
parent 9a6c4a0d6f
commit fed666a5b6

@ -74,7 +74,7 @@ func resourceDigitalOceanSSHKeyRead(d *schema.ResourceData, meta interface{}) er
if err != nil {
// If the key is somehow already destroyed, mark as
// successfully gone
if resp.StatusCode == 404 {
if resp != nil && resp.StatusCode == 404 {
d.SetId("")
return nil
}

Loading…
Cancel
Save