Skip to content

Commit 7666747

Browse files
author
mikatong
committed
fix read role policy is nil
1 parent 8f9eefa commit 7666747

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tencentcloud/services/tco/resource_tc_identity_center_role_configuration_permission_custom_policy_attachment.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,12 @@ func resourceTencentCloudIdentityCenterRoleConfigurationPermissionCustomPolicyAt
171171
}
172172
}
173173

174+
if rolePolicie == nil {
175+
d.SetId("")
176+
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())
177+
return nil
178+
}
179+
174180
if rolePolicie.RolePolicyName != nil {
175181
_ = d.Set("role_policy_name", rolePolicie.RolePolicyName)
176182
}

0 commit comments

Comments
 (0)