From 3e8f85a4b4f89083162d3c955ccc84b74351af95 Mon Sep 17 00:00:00 2001 From: Stephan Date: Thu, 1 Dec 2016 14:30:50 +0100 Subject: [PATCH] Be more tolerant with Xml cache document --- .../XmlPublishedCache/PublishedContentCache.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Web/PublishedCache/XmlPublishedCache/PublishedContentCache.cs b/src/Umbraco.Web/PublishedCache/XmlPublishedCache/PublishedContentCache.cs index 83a4606d19..00782f097e 100644 --- a/src/Umbraco.Web/PublishedCache/XmlPublishedCache/PublishedContentCache.cs +++ b/src/Umbraco.Web/PublishedCache/XmlPublishedCache/PublishedContentCache.cs @@ -217,15 +217,18 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache get { return UmbracoConfig.For.UmbracoSettings().Content.UseLegacyXmlSchema; } } - private int NavigateElementRoute(XmlElement elt, string[] urlParts) + private static int NavigateElementRoute(XmlElement elt, string[] urlParts) { var found = true; var i = 0; while (found && i < urlParts.Length) { found = false; - foreach (XmlElement child in elt.ChildNodes) + foreach (XmlNode childNode in elt.ChildNodes) { + var child = childNode as XmlElement; + if (child == null) continue; // be safe + var noNode = UseLegacySchema ? child.Name != "node" : child.GetAttributeNode("isDoc") == null;