[monodoc] Ditto for fetching type node parents of subnodes.
[mono.git] / mcs / class / monodoc / Monodoc / providers / ecma-provider.cs
index 1cb79c87e946e8cee769f12433857a9b72664eef..53e54c4310bec6f0a4791fec6603e4be6597bc71 100644 (file)
@@ -274,7 +274,8 @@ namespace Monodoc.Providers
                Node GetNodeTypeParent (Node node)
                {
                        // Type nodes are always at level 2 so we just need to get there
-                       while (node != null && node.Parent != null && !node.Parent.Parent.Element.StartsWith ("root:/", StringComparison.OrdinalIgnoreCase))
+                       while (node != null && node.Parent != null
+                              && !node.Parent.Parent.Element.StartsWith ("root:/", StringComparison.OrdinalIgnoreCase) && node.Parent.Parent.Parent != null)
                                node = node.Parent;
                        return node;
                }