Skip to content
Browse files

Merge pull request #77 from mmooney/master

Added null check for CurrentHttpContext
  • Loading branch information...
2 parents f7a9861 + 1747fa0 commit 7cd782b720fc040b7de1db13b63f5e32722ff294 @smsohan committed
Showing with 4 additions and 1 deletion.
  1. +4 −1 Mvc.Mailer/MailerBase.cs
View
5 Mvc.Mailer/MailerBase.cs
@@ -245,7 +245,10 @@ public class MailerBase : ControllerBase {
}
private void CreateControllerContext() {
- var routeData = RouteTable.Routes.GetRouteData(CurrentHttpContext);
+ if (CurrentHttpContext == null) {
+ throw new ArgumentNullException("CurrentHttpContext", "CurrentHttpContext cannot be null");
+ }
+ var routeData = RouteTable.Routes.GetRouteData(CurrentHttpContext);
ControllerContext = new ControllerContext(CurrentHttpContext, routeData, this);
}

0 comments on commit 7cd782b

Please sign in to comment.
Something went wrong with that request. Please try again.