diff --git a/builder/azure/arm/step_get_certificate.go b/builder/azure/arm/step_get_certificate.go index 22403ea94..5f9554aab 100644 --- a/builder/azure/arm/step_get_certificate.go +++ b/builder/azure/arm/step_get_certificate.go @@ -39,6 +39,10 @@ func (s *StepGetCertificate) getCertificateUrl(keyVaultName string, secretName s return "", err } + if secret == nil || secret.ID == nil { + return "", fmt.Errorf("certificate is nil") + } + return *secret.ID, err }