Skip to content

Commit

Permalink
fixes #11715
Browse files Browse the repository at this point in the history
Fixes #11715
  • Loading branch information
favoretti authored May 19, 2021
1 parent 9156afa commit 7fcef19
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions azurerm/internal/services/frontdoor/frontdoor_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -809,14 +809,18 @@ func resourceFrontDoorDelete(d *schema.ResourceData, meta interface{}) error {

future, err := client.Delete(ctx, id.ResourceGroup, id.Name)
if err != nil {
if response.WasNotFound(future.Response()) {
return nil
if future.Response() != nil {
if response.WasNotFound(future.Response()) {
return nil
}
}
return fmt.Errorf("deleting Front Door %q (Resource Group %q): %+v", id.Name, id.ResourceGroup, err)
}
if err = future.WaitForCompletionRef(ctx, client.Client); err != nil {
if !response.WasNotFound(future.Response()) {
return fmt.Errorf("waiting for deleting Front Door %q (Resource Group %q): %+v", id.Name, id.ResourceGroup, err)
if future.Response() != nil {
if !response.WasNotFound(future.Response()) {
return fmt.Errorf("waiting for deleting Front Door %q (Resource Group %q): %+v", id.Name, id.ResourceGroup, err)
}
}
}

Expand Down

0 comments on commit 7fcef19

Please sign in to comment.