From a79aea3bf379ef0752567474d9490279c6818ab1 Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Wed, 5 Jul 2017 14:39:27 -0700 Subject: [PATCH] Tweak null guard --- .../AuthenticationService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Microsoft.AspNetCore.Authentication.Core/AuthenticationService.cs b/src/Microsoft.AspNetCore.Authentication.Core/AuthenticationService.cs index 346f8e14a2..54bdd82d5a 100644 --- a/src/Microsoft.AspNetCore.Authentication.Core/AuthenticationService.cs +++ b/src/Microsoft.AspNetCore.Authentication.Core/AuthenticationService.cs @@ -66,7 +66,7 @@ namespace Microsoft.AspNetCore.Authentication } var result = await handler.AuthenticateAsync(); - if (result?.Succeeded) + if (result != null && result.Succeeded) { var transformed = await Transform.TransformAsync(result.Principal); return AuthenticateResult.Success(new AuthenticationTicket(transformed, result.Properties, result.Ticket.AuthenticationScheme));