From 525ec296554cb48be22b35f62ff12ce15012c11e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Antonio=20Reyes?= Date: Wed, 20 Sep 2023 19:01:22 -0300 Subject: [PATCH] add type assert validation before using value --- pagerduty/terraform_state_snapshot_helper.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pagerduty/terraform_state_snapshot_helper.go b/pagerduty/terraform_state_snapshot_helper.go index 50f5144cc..1e4c0b0a7 100644 --- a/pagerduty/terraform_state_snapshot_helper.go +++ b/pagerduty/terraform_state_snapshot_helper.go @@ -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 }