Skip to content

Commit

Permalink
Merge pull request #15 from rootsami/fix-nullpointer-exception
Browse files Browse the repository at this point in the history
fix(tfstack): null pointer exception once drift is detected
  • Loading branch information
rootsami authored Feb 4, 2023
2 parents 1a13cd7 + 1f84356 commit bc94f18
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/tfstack/tfstack.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ func stackExists(name string, stacks []config.Stack) (stack config.Stack, result
// driftCalculator returns a detailed number of changes that was detected in the plan
func driftCalculator(state *tfjson.Plan) (*DriftSum, error) {

var driftSum *DriftSum
var driftSum DriftSum
for _, resource := range state.ResourceChanges {

for _, action := range resource.Change.Actions {
Expand All @@ -203,7 +203,7 @@ func driftCalculator(state *tfjson.Plan) (*DriftSum, error) {
driftSum.Drift = true
}

return driftSum, nil
return &driftSum, nil
}

// cleanUpPlanFile removes the plan file after the plan has been reported
Expand Down

0 comments on commit bc94f18

Please sign in to comment.