Skip to content

Commit

Permalink
Merge pull request #747 from imjaroiswebdev/crash-on-tf-snapshot-empt…
Browse files Browse the repository at this point in the history
…y-state

Fix - Provider crashing on Terraform state snapshot validation
  • Loading branch information
imjaroiswebdev authored Sep 20, 2023
2 parents 6cb708e + 525ec29 commit 970f9db
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pagerduty/terraform_state_snapshot_helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func (state *tfStateSnapshot) GetResourceStateById(id string) *tfjson.StateResou
return resourceState
}
for _, s := range state.State.Values.RootModule.Resources {
if s.AttributeValues["id"].(string) == id {
if resId, ok := s.AttributeValues["id"].(string); ok && resId == id {
resourceState = s
break
}
Expand Down

0 comments on commit 970f9db

Please sign in to comment.