Skip to content

Commit 9c0876d

Browse files
Fix AST-74615
1 parent 6025a3f commit 9c0876d

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

internal/commands/result.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -961,6 +961,7 @@ func runGetResultCommand(
961961
agent, _ := cmd.Flags().GetString(commonParams.AgentFlag)
962962
scaHideDevAndTestDep, _ := cmd.Flags().GetBool(commonParams.ScaHideDevAndTestDepFlag)
963963
ignorePolicy, _ := cmd.Flags().GetBool(commonParams.IgnorePolicyFlag)
964+
async, _ := cmd.Flags().GetBool(commonParams.AsyncFlag)
964965
waitDelay, _ := cmd.Flags().GetInt(commonParams.WaitDelayFlag)
965966
policyTimeout, _ := cmd.Flags().GetInt(commonParams.PolicyTimeoutFlag)
966967

@@ -986,7 +987,13 @@ func runGetResultCommand(
986987
return errors.Errorf("%s: CODE: %d, %s", failedGettingScan, errorModel.Code, errorModel.Message)
987988
}
988989

989-
policyResponseModel, err := services.HandlePolicyEvaluation(cmd, policyWrapper, scan, ignorePolicy, agent, waitDelay, policyTimeout)
990+
policyResponseModel := &wrappers.PolicyResponseModel{}
991+
if async {
992+
policyResponseModel, err = services.HandlePolicyEvaluation(cmd, policyWrapper, scan, ignorePolicy, agent, waitDelay, policyTimeout)
993+
} else {
994+
policyResponseModel = nil
995+
}
996+
990997
if err != nil {
991998
return err
992999
}

0 commit comments

Comments
 (0)