Skip to content

Commit

Permalink
r/cosmosdb_account: removing a panic when the response is nil (#10525)
Browse files Browse the repository at this point in the history
Fixes #10522
  • Loading branch information
tombuildsstuff authored Feb 11, 2021
1 parent 2e105b5 commit 293f7da
Showing 1 changed file with 1 addition and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -768,11 +768,7 @@ func resourceCosmosDbAccountDelete(d *schema.ResourceData, meta interface{}) err
return err
}

future, err := client.Delete(ctx, id.ResourceGroup, id.Name)
if err != nil {
if future.Response().StatusCode == http.StatusNoContent {
return nil
}
if _, err := client.Delete(ctx, id.ResourceGroup, id.Name); err != nil {
return fmt.Errorf("deleting CosmosDB Account %q (Resource Group %q): %+v", id.Name, id.ResourceGroup, err)
}

Expand Down

0 comments on commit 293f7da

Please sign in to comment.