Skip to content

Commit

Permalink
Fix Possible error when subscription is null in Get-AzRoleAssignment (A…
Browse files Browse the repository at this point in the history
  • Loading branch information
NoriZC committed Oct 23, 2023
1 parent 2b8cc00 commit c79c67a
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ public override void ExecuteCmdlet()
ResourceGroupName = ResourceGroupName,
ResourceName = ResourceName,
ResourceType = ResourceType,
Subscription = string.IsNullOrEmpty(ResourceGroupName) ? null : DefaultProfile.DefaultContext.Subscription.Id
Subscription = string.IsNullOrEmpty(ResourceGroupName) ? null : DefaultProfile.DefaultContext.Subscription?.Id?.ToString()
},
ExpandPrincipalGroups = ExpandPrincipalGroups.IsPresent,
IncludeClassicAdministrators = IncludeClassicAdministrators.IsPresent,
Expand Down

0 comments on commit c79c67a

Please sign in to comment.