This project has moved. For the latest updates, please go here.

Object Reference Error with extension parsing

Dec 6, 2011 at 6:25 PM

I get a "Object reference not set to an instance of an object." when passing in extensions (e.g. .xls). The error is in this call:

DoddleReport.Web.ReportResult.GetWriterFromExtension(ControllerContext context)

 

Coordinator
Dec 6, 2011 at 6:27 PM

I believe I've fixed this in the upcoming source push - if you are around in 10 mins to update and help me test I would appreciate it! I'm hoping to update the NuGet package within the hour

Dec 6, 2011 at 6:34 PM

Yes. Although I have the NuGet package. I can grab the source instead.

Coordinator
Dec 6, 2011 at 6:40 PM

Do you have a stacktrace from the exception? I changed around the code to throw a better exception, but it may not fix it in your scenario. The new exception would tell you that your web.config is missing a registration 



            if(key == null)
                throw new ArgumentException(string.Format("Unable to locate a ReportWriter Configuration with the format '{0}'. Has this format been registered in web.config?", format));

Dec 6, 2011 at 6:45 PM

[NullReferenceException: Object reference not set to an instance of an object.]
   DoddleReport.Web.ReportResult.GetWriterFromExtension(ControllerContext context) +82
   DoddleReport.Web.ReportResult.ExecuteResult(ControllerContext context) +47
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResult(ControllerContext controllerContext, ActionResult actionResult) +39
   Castle.Proxies.ControllerActionInvokerProxy.InvokeActionResult_callback(ControllerContext controllerContext, ActionResult actionResult) +8
   Castle.Proxies.Invocations.ControllerActionInvoker_InvokeActionResult.InvokeMethodOnTarget() +121
   Castle.DynamicProxy.AbstractInvocation.Proceed() +56
   Glimpse.Mvc3.Interceptor.InvokeActionResultInterceptor.Intercept(IInvocation invocation) +335
   Castle.DynamicProxy.AbstractInvocation.Proceed() +94
   Castle.Proxies.ControllerActionInvokerProxy.InvokeActionResult(ControllerContext controllerContext, ActionResult actionResult) +198
   System.Web.Mvc.<>c__DisplayClass1c.<InvokeActionResultWithFilters>b__19() +60
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +391
   System.Web.Mvc.<>c__DisplayClass1e.<InvokeActionResultWithFilters>b__1b() +61
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult) +285
   System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +830
   System.Web.Mvc.Controller.ExecuteCore() +135
   System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext) +232
   System.Web.Mvc.ControllerBase.System.Web.Mvc.IController.Execute(RequestContext requestContext) +39
   System.Web.Mvc.<>c__DisplayClassb.<BeginProcessRequest>b__5() +68
   System.Web.Mvc.Async.<>c__DisplayClass1.<MakeVoidDelegate>b__0() +44
   System.Web.Mvc.Async.<>c__DisplayClass8`1.<BeginSynchronous>b__7(IAsyncResult _) +42
   System.Web.Mvc.Async.WrappedAsyncResult`1.End() +141
   System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag) +54
   System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag) +40
   System.Web.Mvc.<>c__DisplayClasse.<EndProcessRequest>b__d() +61
   System.Web.Mvc.SecurityUtil.<GetCallInAppTrustThunk>b__0(Action f) +31
   System.Web.Mvc.SecurityUtil.ProcessInApplicationTrust(Action action) +56
   System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +110
   System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) +38
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +8964029
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +184

Coordinator
Dec 6, 2011 at 7:32 PM

Latest source is in, if you get a moment to verify please do. If it's good I will publish the nuget package

Dec 7, 2011 at 5:50 PM

Getting source now. Will test. Thanks..

Dec 7, 2011 at 6:00 PM

Latest code fixed my issues. Thanks.