Merge branch 'temp-U4-6659' into 7.4.0

This commit is contained in:
Sebastiaan Janssen
2015-12-03 12:18:58 +01:00

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);
}
}
}
}