Skip to content

Commit

Permalink
fix nil pointer bug with result of diggerexecutor
Browse files Browse the repository at this point in the history
  • Loading branch information
motatoes committed Feb 1, 2024
1 parent 28c1d79 commit 2893d4b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions cli/pkg/digger/digger.go
Original file line number Diff line number Diff line change
Expand Up @@ -266,11 +266,6 @@ func run(command string, job orchestrator.Job, policyChecker policy.Checker, org
return nil, msg, fmt.Errorf(msg)
}
planSummary, planPerformed, isNonEmptyPlan, plan, planJsonOutput, err := diggerExecutor.Plan()
result := execution.DiggerExecutorResult{
PlanResult: &execution.DiggerExecutorPlanResult{
PlanSummary: *planSummary,
},
}

if err != nil {
msg := fmt.Sprintf("Failed to Run digger plan command. %v", err)
Expand All @@ -281,8 +276,13 @@ func run(command string, job orchestrator.Job, policyChecker policy.Checker, org
return nil, msg, fmt.Errorf(msg)
}

return &result, msg, fmt.Errorf(msg)
return nil, msg, fmt.Errorf(msg)
} else if planPerformed {
result := execution.DiggerExecutorResult{
PlanResult: &execution.DiggerExecutorPlanResult{
PlanSummary: *planSummary,
},
}
if isNonEmptyPlan {
reportTerraformPlanOutput(reporter, projectLock.LockId(), plan)
planIsAllowed, messages, err := policyChecker.CheckPlanPolicy(SCMrepository, SCMOrganisation, job.ProjectName, planJsonOutput)
Expand Down

0 comments on commit 2893d4b

Please sign in to comment.