--- title: "`Sitecore.ContentSearch.SitecoreItemCrawler.IsAncestorOf(Item item)` error" slug: '2486' canonical_url: https://docs.coveo.com/en/2486/ collection: coveo-for-sitecore-v5 source_format: adoc --- # `Sitecore.ContentSearch.SitecoreItemCrawler.IsAncestorOf(Item item)` error ## Symptoms You see this message in your Sitecore logs : ```text 6048 22:49:54 ERROR Application error. Exception: System.NullReferenceException Message: Object reference not set to an instance of an object. Source: Sitecore.ContentSearch at Sitecore.ContentSearch.SitecoreItemCrawler.IsAncestorOf(Item item) at Sitecore.ContentSearch.SitecoreItemCrawler.IsExcludedFromIndex(SitecoreIndexableItem indexable, Boolean checkLocation) at Sitecore.ContentSearch.Pipelines.GetContextIndex.FetchIndex.<>c\_\_DisplayClass9.<GetContextIndex>b\_\_3(<>f\_\_AnonymousType1# `Sitecore.ContentSearch.SitecoreItemCrawler.IsAncestorOf(Item item)` error ## Symptoms You see this message in your Sitecore logs : 2 <>h\_\_TransparentIdentifier0) ... ``` In addition, `\http:///coveo/rest` is returning 500 errors all of a sudden. ## Explanation This error can occur if a new index/crawler is added to the `web.config` and if the root of that item is only in the `master` database (that is, it's not yet published in the `web` database). This is also true if a crawler root is modified to an item that isn't yet in the `web` database. The reason is that when Sitecore tries to fetch the index for an item, it lists all the crawlers and filters out the ones that aren't supposed to crawl the item. The method is fragile as it doesn't do null checks. Sitecore seems aware of the issues in that method and has provided a workaround as we can see in StackOverflow (see links below). ## Resolution You need to fix the new component that you introduced. Follow the links below for more details on how to do so. * [Vulnerability with Using the Sitecore Context Search Index](http://elenazlateva.blogspot.ca/2014/10/vulnerability-with-using-sitecore.html) * [Sitecore 7 Content Search Indexing Items Outside of Crawler Root](https://stackoverflow.com/q/22214161)