Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/dotnet/aspnetcore.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPranav K <prkrishn@hotmail.com>2019-01-26 00:47:07 +0300
committerArtak <34246760+mkArtakMSFT@users.noreply.github.com>2019-01-26 02:38:23 +0300
commit1aa50faa290ecda304507981cd01ed92651d5e34 (patch)
tree53e7d4f06bd71ac2bef0e4ef235da3ae6f5810bd
parentf2ee3201ae2667e233ce3c0c9afe41ea99161fe4 (diff)
Account for null Endpointv3.0.0-preview-19075-0444
-rw-r--r--src/Security/Authorization/Policy/src/AuthorizationMiddleware.cs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/Security/Authorization/Policy/src/AuthorizationMiddleware.cs b/src/Security/Authorization/Policy/src/AuthorizationMiddleware.cs
index 5b6426dc5e..6284eea15d 100644
--- a/src/Security/Authorization/Policy/src/AuthorizationMiddleware.cs
+++ b/src/Security/Authorization/Policy/src/AuthorizationMiddleware.cs
@@ -47,7 +47,7 @@ namespace Microsoft.AspNetCore.Authorization
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;