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