Skip to content

Commit

Permalink
Account for null Endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
pranavkm authored and mkArtakMSFT committed Jan 25, 2019
1 parent f2ee320 commit 1aa50fa
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -47,7 +47,7 @@ public async Task Invoke(HttpContext context)
var endpoint = context.GetEndpoint();

// Workaround for https://github.com/aspnet/AspNetCore/issues/7011. Do not use the AuthorizationMiddleware for Razor Pages
if (endpoint.Metadata.Any(m => m.GetType().FullName == "Microsoft.AspNetCore.Mvc.ApplicationModels.PageRouteMetadata"))
if (endpoint != null && endpoint.Metadata.Any(m => m.GetType().FullName == "Microsoft.AspNetCore.Mvc.ApplicationModels.PageRouteMetadata"))
{
await _next(context);
return;
Expand Down

0 comments on commit 1aa50fa

Please sign in to comment.