NickCraver / StackExchange.Exceptional

Error handler used for the Stack Exchange network
https://nickcraver.com/StackExchange.Exceptional/
Apache License 2.0
863 stars 171 forks source link

Linkify throws an exception when there's no HttpContext #78

Closed tsmith-sdm closed 7 years ago

tsmith-sdm commented 7 years ago

Linkify throws an exception when there's no HttpContext where it tries to access the SiteUrl for example in a background thread.

System.NullReferenceException: Object reference not set to an instance of an object.
   at StackExchange.Exceptional.Email.ErrorEmail.Linkify(String s) in C:\BuildAgent\work\d20fce4a5bb47bd3\Email\ErrorEmail.cshtml:line 111
   at StackExchange.Exceptional.Email.ErrorEmail.Execute() in C:\BuildAgent\work\d20fce4a5bb47bd3\Email\ErrorEmail.cshtml:line 160
   at StackExchange.Exceptional.RazorPageBase.TransformText() in C:\BuildAgent\work\d20fce4a5bb47bd3\StackExchange.Exceptional\RazorPage.cs:line 57
   at StackExchange.Exceptional.Email.ErrorEmailer.GetErrorHtml(Error error) in C:\BuildAgent\work\d20fce4a5bb47bd3\StackExchange.Exceptional\Email\ErrorEmailer.cs:line 112
   at StackExchange.Exceptional.Email.ErrorEmailer.SendMail(Error error) in C:\BuildAgent\work\d20fce4a5bb47bd3\StackExchange.Exceptional\Email\ErrorEmailer.cs:line 74
NickCraver commented 7 years ago

This is fixed in the v2 branch (totally different encoding approach) - will close this out when it's in master and available on NuGet.

NickCraver commented 7 years ago

We've merged into master - and in the coming weeks we'll be on MyGet and NuGet as well - closing this out to clean up :)