diff --git a/src/Microsoft.AspNet.Identity.Core/ClaimsIdentityFactory.cs b/src/Microsoft.AspNet.Identity.Core/ClaimsIdentityFactory.cs index da2f755..a53b817 100644 --- a/src/Microsoft.AspNet.Identity.Core/ClaimsIdentityFactory.cs +++ b/src/Microsoft.AspNet.Identity.Core/ClaimsIdentityFactory.cs @@ -101,7 +101,7 @@ public virtual async Task CreateAsync(UserManager m } if (manager.SupportsUserRole) { - IList roles = await manager.GetRolesAsync(user.Id).WithCurrentCulture(); + IList roles = await manager.GetRolesAsync(user.Id).WithCurrentCulture() ?? []; foreach (string roleName in roles) { id.AddClaim(new Claim(RoleClaimType, roleName, ClaimValueTypes.String)); @@ -128,4 +128,4 @@ public virtual string ConvertIdToString(TKey key) return key.ToString(); } } -} \ No newline at end of file +}