NullReferenceException when my MVC controller has properties

Posted by Community Admin on 04-Aug-2018 22:14

NullReferenceException when my MVC controller has properties with certain names

All Replies

Posted by Community Admin on 12-Mar-2014 00:00

 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

Posted by Community Admin on 12-Mar-2014 00:00

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.

Posted by Community Admin on 12-Mar-2014 00:00

Yup, confirmed that my problem wasn't a bug. Sorry for the bogus post!

This thread is closed