Skip to content

Commit

Permalink
add empty response case for assigning roles
Browse files Browse the repository at this point in the history
  • Loading branch information
vinay-gopalan committed Nov 10, 2023
1 parent 359ed8f commit 457c916
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,11 @@ func (c *client) assignRoles(ctx context.Context, spID string, roles []*AzureRol
if err != nil && strings.Contains(err.Error(), "PrincipalNotFound") {
return nil, false, nil
}
// check if ra is an empty response
// if so, return empty string
if ra == (armauthorization.RoleAssignmentsClientCreateResponse{}) {
return "", true, err
}
return *ra.ID, true, err
})

Expand Down

0 comments on commit 457c916

Please sign in to comment.