Skip to content

Commit

Permalink
add nil check when unassigning roles (#191)
Browse files Browse the repository at this point in the history
  • Loading branch information
vinay-gopalan authored Apr 17, 2024
1 parent f41a8a7 commit 355bb4f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion client.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ func (c *client) unassignRoles(ctx context.Context, roleIDs []string) error {
ctxWithResp := policy.WithCaptureResponse(ctx, &rawResponse)
if _, err := c.provider.DeleteRoleAssignmentByID(ctxWithResp, id); err != nil {
// If a role was deleted manually then Azure returns a error and status 204
if rawResponse.StatusCode == http.StatusNoContent || rawResponse.StatusCode == http.StatusNotFound {
if rawResponse != nil && rawResponse.StatusCode == http.StatusNoContent || rawResponse.StatusCode == http.StatusNotFound {
continue
}

Expand Down

0 comments on commit 355bb4f

Please sign in to comment.