+1-888-365-2779
Try Now
More in this section

Forums / Bugs & Issues / NullReferenceException when my MVC controller has properties with certain names

NullReferenceException when my MVC controller has properties with certain names

3 posts, 3 answered
  1. Bo Chulindra
    Bo Chulindra avatar
    35 posts
    Registered:
    17 Dec 2013
    12 Mar 2014
    Link to this post

     I have a widget whose controller is named RegistrationController. The controller has a public property named RegistrationText. When I try to visit a page that has the widget on it, I get the error and stack trace below. If I rename the property to IntroductionText, the error does not occur.

    Sitefinity version 6.3.5000.0

    The controller has the following attribute: [ControllerToolboxItem(Name = "Registration", Title = "Registration", SectionName = <removed>)]

    [NullReferenceException: Object reference not set to an instance of an object.]
    Telerik.Sitefinity.Mvc.Proxy.MvcPropertySerializer.DeserializeProperties(String serializedProperties, Object proxyInstance) +331
    Telerik.Sitefinity.Mvc.Proxy.MvcControllerProxy.ExecuteController() +2333
    System.Web.UI.Control.PreRenderRecursiveInternal() +154
    System.Web.UI.Control.PreRenderRecursiveInternal() +239
    System.Web.UI.Control.PreRenderRecursiveInternal() +239
    System.Web.UI.Control.PreRenderRecursiveInternal() +239
    System.Web.UI.Control.PreRenderRecursiveInternal() +239
    System.Web.UI.Control.PreRenderRecursiveInternal() +239
    System.Web.UI.Control.PreRenderRecursiveInternal() +239
    System.Web.UI.Control.PreRenderRecursiveInternal() +239
    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +4089

    Answered
  2. Bo Chulindra
    Bo Chulindra avatar
    35 posts
    Registered:
    17 Dec 2013
    12 Mar 2014
    Link to this post
    Actually never mind, I'm pretty sure my problem was that I had changed the property's name and my page's widget was still using the old property name.
    Answered
  3. Bo Chulindra
    Bo Chulindra avatar
    35 posts
    Registered:
    17 Dec 2013
    12 Mar 2014 in reply to Bo Chulindra
    Link to this post
    Yup, confirmed that my problem wasn't a bug. Sorry for the bogus post!
    Answered
3 posts, 3 answered