From e5e174d3341ef2f04b3bcab1f26bf6eb56e4724b Mon Sep 17 00:00:00 2001 From: leekelleher Date: Mon, 7 Aug 2017 14:06:03 +0100 Subject: [PATCH] Nested Content with ModelsBuilder disabled will throw a null-reference exception. The fix is to check if the `Current` instance as a `Value`. For more details, see ticket: http://issues.umbraco.org/issue/U4-10260 --- .../NestedContentPublishedPropertyTypeExtensions.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Umbraco.Web/PropertyEditors/ValueConverters/NestedContentPublishedPropertyTypeExtensions.cs b/src/Umbraco.Web/PropertyEditors/ValueConverters/NestedContentPublishedPropertyTypeExtensions.cs index cb26ef6786..ebfdbd33d3 100644 --- a/src/Umbraco.Web/PropertyEditors/ValueConverters/NestedContentPublishedPropertyTypeExtensions.cs +++ b/src/Umbraco.Web/PropertyEditors/ValueConverters/NestedContentPublishedPropertyTypeExtensions.cs @@ -108,7 +108,7 @@ namespace Umbraco.Web.PropertyEditors.ValueConverters i, preview); - if (PublishedContentModelFactoryResolver.HasCurrent) + if (PublishedContentModelFactoryResolver.HasCurrent && PublishedContentModelFactoryResolver.Current.HasValue) { // Let the current model factory create a typed model to wrap our model content = PublishedContentModelFactoryResolver.Current.Factory.CreateModel(content);