Fixes: U4-6659 Examine: Specific doctype not being indexed

This commit is contained in:
Shannon
2015-11-19 19:06:31 +01:00
parent 58c3dfac1c
commit 2ba7cdc789

View File

@@ -460,8 +460,19 @@ namespace UmbracoExamine
if (xDoc != null)
{
var rootNode = xDoc.Root;
AddNodesToIndex(rootNode.Elements(), type);
if (rootNode != null)
{
//the result will either be a single doc with an id as the root, or it will
// be multiple docs with a <nodes> wrapper, we need to check for this
if (rootNode.HasAttributes)
{
AddNodesToIndex(new[] {rootNode}, type);
}
else
{
AddNodesToIndex(rootNode.Elements(), type);
}
}
}
}