From 1118d957731f24f2d8dc4ad80f7f8663fd6d209d Mon Sep 17 00:00:00 2001 From: Shannon Date: Mon, 25 Jan 2016 11:14:06 +0100 Subject: [PATCH] added a null check --- .../Services/ApplicationTreeService.cs | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/Umbraco.Core/Services/ApplicationTreeService.cs b/src/Umbraco.Core/Services/ApplicationTreeService.cs index f2c1c5e8f8..1491a59776 100644 --- a/src/Umbraco.Core/Services/ApplicationTreeService.cs +++ b/src/Umbraco.Core/Services/ApplicationTreeService.cs @@ -107,7 +107,20 @@ namespace Umbraco.Core.Services } else { - doc.Root.Add(new XElement("add", + if (tree.Title.IsNullOrWhiteSpace()) + { + doc.Root.Add(new XElement("add", + new XAttribute("initialize", tree.Initialize), + new XAttribute("sortOrder", tree.SortOrder), + new XAttribute("alias", tree.Alias), + new XAttribute("application", tree.ApplicationAlias), + new XAttribute("iconClosed", tree.IconClosed), + new XAttribute("iconOpen", tree.IconOpened), + new XAttribute("type", tree.Type))); + } + else + { + doc.Root.Add(new XElement("add", new XAttribute("initialize", tree.Initialize), new XAttribute("sortOrder", tree.SortOrder), new XAttribute("alias", tree.Alias), @@ -116,6 +129,8 @@ namespace Umbraco.Core.Services new XAttribute("iconClosed", tree.IconClosed), new XAttribute("iconOpen", tree.IconOpened), new XAttribute("type", tree.Type))); + } + } count++; }