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
This commit is contained in:
leekelleher
2017-08-07 14:06:03 +01:00
parent 51624cee57
commit e5e174d334

View File

@@ -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);