Skip to content

Commit

Permalink
fix nilpointer exception (#1119)
Browse files Browse the repository at this point in the history
  • Loading branch information
motatoes authored Feb 5, 2024
1 parent 65ed2b5 commit 043ac22
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 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 @@ -280,8 +275,7 @@ func run(command string, job orchestrator.Job, policyChecker policy.Checker, org
msg := fmt.Sprintf("Failed to set PR status. %v", err)
return nil, msg, fmt.Errorf(msg)
}

return &result, msg, fmt.Errorf(msg)
return nil, msg, fmt.Errorf(msg)
} else if planPerformed {
if isNonEmptyPlan {
reportTerraformPlanOutput(reporter, projectLock.LockId(), plan)
Expand Down Expand Up @@ -327,6 +321,11 @@ func run(command string, job orchestrator.Job, policyChecker policy.Checker, org
msg := fmt.Sprintf("Failed to set PR status. %v", err)
return nil, msg, fmt.Errorf(msg)
}
result := execution.DiggerExecutorResult{
PlanResult: &execution.DiggerExecutorPlanResult{
PlanSummary: *planSummary,
},
}
return &result, plan, nil
}
case "digger apply":
Expand Down

0 comments on commit 043ac22

Please sign in to comment.