smsohan / MvcMailer

A Mailer for ASP.Net MVC that forms the Email Body using MVC Views (Razor etc.) following Ruby on Rails ActionMailer style
MIT License
582 stars 178 forks source link

Added null check for CurrentHttpContext #77

Closed mmooney closed 11 years ago

mmooney commented 11 years ago

This was a small thing that bit me when I first tried to use MvcMailer. I had not passed in an HttpContext and it exploded (as it should), but it gave me a object reference error. I just added a check for to throw a specific exception message if it's null instead of throwing a generic object reference exception