mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-25 18:45:20 -06:00
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:
parent
9a6c4a0d6f
commit
fed666a5b6
@ -74,7 +74,7 @@ func resourceDigitalOceanSSHKeyRead(d *schema.ResourceData, meta interface{}) er
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
// If the key is somehow already destroyed, mark as
|
// If the key is somehow already destroyed, mark as
|
||||||
// successfully gone
|
// successfully gone
|
||||||
if resp.StatusCode == 404 {
|
if resp != nil && resp.StatusCode == 404 {
|
||||||
d.SetId("")
|
d.SetId("")
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user