From adbb48e21c793df2e551ffcff27f979d2f8a55d8 Mon Sep 17 00:00:00 2001 From: hartvig Date: Mon, 14 Jun 2010 19:17:57 +0000 Subject: [PATCH] Fixes 27569 [TFS Changeset #68593] --- umbraco/presentation/umbraco/nodeFactory/Page.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/umbraco/presentation/umbraco/nodeFactory/Page.cs b/umbraco/presentation/umbraco/nodeFactory/Page.cs index 8e378ff85e..adf4517505 100644 --- a/umbraco/presentation/umbraco/nodeFactory/Page.cs +++ b/umbraco/presentation/umbraco/nodeFactory/Page.cs @@ -422,9 +422,12 @@ namespace umbraco.presentation.nodeFactory { // Load parent if it exists and is a node - if (_pageXmlNode != null && _pageXmlNode.SelectSingleNode("..") != null && ( - _pageXmlNode.SelectSingleNode("..").Name == "node" || _pageXmlNode.SelectSingleNode("..").Attributes.GetNamedItem("isDoc") != null)) - _parent = new Node(_pageXmlNode.SelectSingleNode(".."), true); + if (_pageXmlNode != null && _pageXmlNode.SelectSingleNode("..") != null) + { + XmlNode parent = _pageXmlNode.SelectSingleNode(".."); + if (parent != null && (parent.Name == "node" || (parent.Attributes != null && parent.Attributes.GetNamedItem("isDoc") != null))) + _parent = new Node(parent, true); + } } private void initialize()