add check for master not being equal to template

This commit is contained in:
Mads Rasmussen
2017-01-10 12:22:18 +01:00
parent 4c461a733b
commit 9718324e6e

View File

@@ -110,11 +110,16 @@ namespace Umbraco.Web.Editors
{
if (string.IsNullOrEmpty(display.MasterTemplateAlias) == false)
{
var master = Services.FileService.GetTemplate(display.MasterTemplateAlias);
if (master != null)
{
template.SetMasterTemplate(master);
if(master == null || master.Id == display.Id)
{
template.SetMasterTemplate(null);
}else
{
template.SetMasterTemplate(master);
}
}
else
{