Hi,
I get an exception when executing a custom webpart. What can be the cause for this?
Message: Object reference not set to an instance of an object.
Stack Trace:
at CMSModules_OnlineMarketing_Controls_Content_VariantSlider.get_VariantMode() in \CMSModules\OnlineMarketing\Controls\Content\VariantSlider.ascx.cs:line 159
at CMSModules_OnlineMarketing_Controls_Content_VariantSlider.CheckPermissions(String permissionName) in \CMSModules\OnlineMarketing\Controls\Content\VariantSlider.ascx.cs:line 180
at CMSModules_OnlineMarketing_Controls_Content_VariantSlider.OnInit(EventArgs e) in \CMSModules\OnlineMarketing\Controls\Content\VariantSlider.ascx.cs:line 209
at System.Web.UI.Control.InitRecursive(Control namingContainer)
at System.Web.UI.Control.AddedControl(Control control, Int32 index)
at CMS.PortalControls.CMSAbstractWebPart.OnLoad(EventArgs e)
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
The custom webpart itself tries to check a user permission like this:
CMSContext.CurrentUser.IsAuthorizedPerResource(resourceName, permission.ToString());