Try our conversational search powered by Generative AI!

[WebForms] NullReferenceException when editing empty LinkCollection property in OPE mode

Found in

EPiServer.CMS.Core 10.9.0

Fixed in

EPiServer.CMS.Core 10.9.1

(Or a related package)

Created

May 09, 2017

Updated

May 12, 2017

Area

CMS Core

State

Closed, Fixed and tested


Description

Steps to reproduce:

1. Create a new page that has a WebForms template with a LinkCollection property. (You may create new Start page then configure it for new website in Alloy sample site).
2. The LinkCollection property value is empty.
3. Open the page in OPE mode.

Expected:
Show the overlay item of LinkCollection property for editing.

Actual:
Show NullReferenceException as below.

Observed: No exception after adding an item into the LinkCollection property in All Properties mode.

Stack Trace:
[NullReferenceException: Object reference not set to an instance of an object.]
EPiServer.Web.PropertyControls.PropertyLinkCollectionControl.CreateDefaultControls()
+242
EPiServer.Web.PropertyControls.PropertyDataControl.CreateOnPageEditControls() +23
EPiServer.Web.PropertyControls.PropertyDataControl.CreateChildControls() +57
System.Web.UI.Control.EnsureChildControls() +114
EPiServer.Web.WebControls.Property.CreateChildControls() +635
System.Web.UI.Control.EnsureChildControls() +114
System.Web.UI.Control.PreRenderRecursiveInternal() +57
System.Web.UI.Control.PreRenderRecursiveInternal() +206
System.Web.UI.Control.PreRenderRecursiveInternal() +206
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2993