Skip to content

Commit 0a292eb

Browse files
authored
Added null check before accessing AuthenticationType property of RpcClaimIdentity instance. (#673)
1 parent ff387c3 commit 0a292eb

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/DotNetWorker.Grpc/Http/GrpcHttpRequestData.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,10 @@ public GrpcHttpRequestData(RpcHttp httpData, FunctionContext functionContext)
3737

3838
if (cookieString != null && cookieString.Any())
3939
{
40-
4140
return ToHttpCookies(cookieString.First());
4241
}
4342

4443
return Array.Empty<IHttpCookie>();
45-
4644
});
4745
}
4846

@@ -103,7 +101,7 @@ public override IEnumerable<ClaimsIdentity> Identities
103101
{
104102
_identities = _httpData.Identities?.Select(id =>
105103
{
106-
var identity = new ClaimsIdentity(id.AuthenticationType.Value, id.NameClaimType.Value, id.RoleClaimType.Value);
104+
var identity = new ClaimsIdentity(id.AuthenticationType?.Value, id.NameClaimType.Value, id.RoleClaimType.Value);
107105
identity.AddClaims(id.Claims.Select(c => new Claim(c.Type, c.Value)));
108106

109107
return identity;

0 commit comments

Comments
 (0)