Skip to content

Commit

Permalink
fix(tco): [123456789] read role policy is nil (#3031)
Browse files Browse the repository at this point in the history
* fix read role policy is nil

* add changelog

* update

---------

Co-authored-by: mikatong <[email protected]>
  • Loading branch information
tongyiming and mikatong authored Dec 20, 2024
1 parent 0f216b4 commit 39632b5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .changelog/3031.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
resource/tencentcloud_identity_center_role_configuration_permission_custom_policy_attachment: fix code panic
```
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,11 @@ func resourceTencentCloudIdentityCenterRoleConfigurationPermissionCustomPolicyAt
}
}

if rolePolicie == nil {
log.Printf("[WARN]%s resource `identity_center_role_configuration_permission_policy_attachment` [%s] not found, please check if it has been deleted.\n", logId, d.Id())
return fmt.Errorf("RolePolicy %s is not exist", d.Id())
}

if rolePolicie.RolePolicyName != nil {
_ = d.Set("role_policy_name", rolePolicie.RolePolicyName)
}
Expand Down

0 comments on commit 39632b5

Please sign in to comment.