From 3a02ea99ff226cb3886b9ffcb7b611579403a952 Mon Sep 17 00:00:00 2001 From: Pedro Lopes Date: Wed, 11 Oct 2023 15:18:39 +0100 Subject: [PATCH] check policies --- internal/commands/scan.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/commands/scan.go b/internal/commands/scan.go index 2f46df28a..129616cd1 100644 --- a/internal/commands/scan.go +++ b/internal/commands/scan.go @@ -1480,7 +1480,7 @@ func runCreateScanCommand( cleanUpTempZip(zipFilePath) // verify break build from policy - if len(policyResponseModel.Polices) > 0 && policyResponseModel.BreakBuild { + if policyResponseModel != nil && len(policyResponseModel.Polices) > 0 && policyResponseModel.BreakBuild { logger.PrintIfVerbose("Breaking the build due to policy violation") return errors.Errorf("Policy Violation - Break Build Enabled. To bypass the policy evaluation and continue with the build, you can use the `--ignore-policy` flag.") }