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 authored Sep 13, 2023
1 parent 2034f75 commit c962a07
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,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 c962a07

Please sign in to comment.