Fix Template Import when template has no master
Importing a template with no master template (i.e when it's at the root) caused an error. Added check for MasterTemplateId != null - (tried .IsValueCreated but that generated a object not set exception)
This commit is contained in:
@@ -1631,7 +1631,7 @@ namespace Umbraco.Core.Services
|
||||
xml.Add(new XElement("Design", new XCData(template.Content)));
|
||||
|
||||
var concreteTemplate = template as Template;
|
||||
if (concreteTemplate != null)
|
||||
if (concreteTemplate != null && concreteTemplate.MasterTemplateId != null)
|
||||
{
|
||||
if (concreteTemplate.MasterTemplateId.IsValueCreated &&
|
||||
concreteTemplate.MasterTemplateId.Value != default(int))
|
||||
|
||||
Reference in New Issue
Block a user