Skip to content

Commit fa15318

Browse files
authored
Check AuthenticateResult of IAuthenticateResultFeature is not null. (#1918)
1 parent fb60e1c commit fa15318

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Microsoft.Azure.SignalR/HubHost/NegotiateHandler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ private IEnumerable<Claim> BuildClaims(HttpContext context)
138138
#if NET6_0_OR_GREATER
139139
closeOnAuthenticationExpiration = _dispatcherOptions.CloseOnAuthenticationExpiration;
140140
var authResultFeature = context.Features.Get<IAuthenticateResultFeature>();
141-
if (authResultFeature != null && authResultFeature.AuthenticateResult.Succeeded)
141+
if (authResultFeature != null && authResultFeature.AuthenticateResult != null && authResultFeature.AuthenticateResult.Succeeded)
142142
{
143143
authenticationExpiresOn = authResultFeature.AuthenticateResult.Properties.ExpiresUtc;
144144
}

0 commit comments

Comments
 (0)