Skip to content

Commit 502a89f

Browse files
Update src/Microsoft.Owin.Security.Authorization.Mvc/ResourceAuthorizeAttribute.cs
Co-Authored-By: David Parks <[email protected]>
1 parent fcaa139 commit 502a89f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Microsoft.Owin.Security.Authorization.Mvc/ResourceAuthorizeAttribute.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ protected override bool AuthorizeCore(HttpContextBase httpContext)
4646
}
4747

4848
var filterContext = httpContext.Items[s_authorizationContextKey] as System.Web.Mvc.AuthorizationContext;
49-
var controller = filterContext.Controller as IAuthorizationController;
49+
var controller = filterContext?.Controller as IAuthorizationController;
5050
var user = (ClaimsPrincipal)httpContext.User;
5151
var contextAccessor = new HttpContextBaseOwinContextAccessor(httpContext);
5252
var authorizationHelper = new AuthorizationHelper(contextAccessor);

0 commit comments

Comments
 (0)