AspNetRequest constructor throws NRE randomly

Every now and then, I’ll find this NRE in our Raygun crash reporting with this stack trace…

Message: [NullReferenceException: Object reference not set to an instance of an object.]
ServiceStack.Host.AspNet.AspNetRequest..ctor(HttpContextBase httpContext, String operationName, RequestAttributes requestAttributes):20
ServiceStack.Mvc.ServiceStackController.get_ServiceStackProvider():28
ServiceStack.Mvc.ServiceStackController.Execute(Object requestDto):0
System.Web.Mvc.Controller.<BeginExecuteCore>b__1d(IAsyncResult asyncResult, ExecuteCoreState innerState):15
System.Web.Mvc.Async.AsyncResultWrapper+WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult):0
System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult):0
System.Web.Mvc.Async.AsyncResultWrapper+WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult):0
System.Web.Mvc.MvcHandler.<BeginProcessRequest>b__5(IAsyncResult asyncResult, ProcessRequestState innerState):0
System.Web.Mvc.Async.AsyncResultWrapper+WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult):0
System.Web.HttpApplication+CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute():316
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously):54

I’m not sure what is causing this as it seems random. When I log in as the user and hit the exact same path using the same form parameters, etc, I can’t reproduce it. Any ideas?

I did just find that the crash report indicates that the hit to that action was a GET instead of a POST. My Razor has it as a Ajax.ActionLink with new AjaxOptions { HttpMethod = "POST" } and my ServiceStackController action is decorated with [HttpPost] so I’m not sure how that even happened.

Given that, I tried a manual GET to that action and was able to reproduce the NRE seen in Raygun.