Skip to content

Commit

Permalink
Merge pull request #3133 from jackpoz/fixed/InvokeGraphMethodNullExce…
Browse files Browse the repository at this point in the history
…ption

Fix Invoke-PnPGraphMethod null exception
  • Loading branch information
gautamdsheth authored May 23, 2023
2 parents e953d65 + 4dd469e commit 2192bf7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Commands/Base/TokenHandling.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ internal static void ValidateTokenForPermissions(Type cmdletType, string token)
{
requiredScopes = requiredScopesAttribute.PermissionScopes;
}
if (requiredScopes.Length > 0)
if (requiredScopes?.Length > 0)
{
var decodedToken = new JwtSecurityToken(token);
var roles = decodedToken.Claims.FirstOrDefault(c => c.Type == "roles");
Expand Down

0 comments on commit 2192bf7

Please sign in to comment.