Skip to content

Commit

Permalink
azurerm_key_vault_access_policy: Extra nil check to prevent crash (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
aristosvo authored Jul 15, 2021
1 parent 3b9d358 commit 2e75ff7
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,11 @@ func resourceKeyVaultAccessPolicyCreateOrDelete(d *pluginsdk.ResourceData, meta
if resp.Properties == nil || resp.Properties.AccessPolicies == nil {
return fmt.Errorf("failed reading Access Policies for %q (resource group %q)", vaultName, id.ResourceGroup)
}

accessPolicyRaw := FindKeyVaultAccessPolicy(resp.Properties.AccessPolicies, objectId, applicationIdRaw)
if accessPolicyRaw == nil {
return fmt.Errorf("failed finding this specific Access Policy on Azure KeyVault %q (resource group %q)", vaultName, id.ResourceGroup)
}
accessPolicy = *accessPolicyRaw

default:
Expand Down

0 comments on commit 2e75ff7

Please sign in to comment.