Skip to content

Commit

Permalink
Fix: case when resource is nil
Browse files Browse the repository at this point in the history
  • Loading branch information
obierlaire committed Aug 2, 2023
1 parent d7f6fa4 commit d344676
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions internal/plan/resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,15 @@ func GetResources(tfPlan *tfjson.Plan) (map[string]resources.Resource, error) {
if priorRes.Mode == "data" {
if strings.HasPrefix(priorRes.Type, "google") {
dataResource := gcp.GetDataResource(*priorRes)
terraformRefs.DataResources[dataResource.GetKey()] = dataResource
if dataResource != nil {
terraformRefs.DataResources[dataResource.GetKey()] = dataResource
}
}
if strings.HasPrefix(priorRes.Type, "aws") {
dataResource := aws.GetDataResource(*priorRes)
terraformRefs.DataResources[dataResource.GetKey()] = dataResource
if dataResource != nil {
terraformRefs.DataResources[dataResource.GetKey()] = dataResource
}
}
}
}
Expand Down

0 comments on commit d344676

Please sign in to comment.