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.
This commit is contained in:
James Nugent 2016-03-21 14:25:11 +00:00
parent 9a6c4a0d6f
commit fed666a5b6
1 changed files with 1 additions and 1 deletions

View File

@ -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
}