From 98eb31194cd2417eddfd7965df02555c1477f5dc Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Wed, 5 Jul 2017 13:33:39 -0700 Subject: [PATCH] Guard against null --- .../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 e9fcfc0b9f..346f8e14a2 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?.Succeeded) { var transformed = await Transform.TransformAsync(result.Principal); return AuthenticateResult.Success(new AuthenticationTicket(transformed, result.Properties, result.Ticket.AuthenticationScheme));