Skip to content

Commit

Permalink
azurerm_key_vault_access_policy: Extra nil check to prevent crash (h…
Browse files Browse the repository at this point in the history
  • Loading branch information
aristosvo authored and yupwei68 committed Jul 26, 2021
1 parent 0068c05 commit 5a43792
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 5a43792

Please sign in to comment.