Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix null ref in DefaultControllerFactory #6

Closed
Eilon opened this issue Jul 23, 2016 · 2 comments
Closed

Fix null ref in DefaultControllerFactory #6

Eilon opened this issue Jul 23, 2016 · 2 comments
Assignees

Comments

@Eilon
Copy link
Member

Eilon commented Jul 23, 2016

See original code in https://aspnetwebstack.codeplex.com/SourceControl/network/forks/Therzok/fixNRERegression/contribution/5358

<! RouteData routeData = requestContext.RouteData;   
!> RouteData routeData = requestContext != null ? requestContext.RouteData : null;  
@Eilon Eilon modified the milestone: 5.2.4 Jul 23, 2016
@dougbu
Copy link
Member

dougbu commented Oct 8, 2017

NRE fixed in the original PR is no longer an issue because the method (GetControllerType(...)) now throws an ArgumentNullException a few lines earlier when requestContext == null.

On the other hand, DefaultControllerFactory lacks a null check for the RequestContext parameter in GetControllerInstance(...) and CreateController(...) and GetControllerType(...) both mishandle requestContext.RouteData. I'll send out a PR to address those small issues.

@dougbu
Copy link
Member

dougbu commented Oct 17, 2017

3482799

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants