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:
Kevin Jump
2014-01-23 16:07:07 +00:00
parent a705561a51
commit 57c68daf38

View File

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