# Error with IndexExists

**URL:** <https://discuss.elastic.co/t/error-with-indexexists/118220>\
**Category:** Elasticsearch\
**Created:** [February 2, 2018, 11:24am UTC](https://discuss.elastic.co/t/error-with-indexexists/118220 "2018-02-02T11:24:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![BernardTheDog](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bernardthedog/32/16498_2.png) [@BernardTheDog](https://discuss.elastic.co/u/BernardTheDog)\
**Post date:** [February 2, 2018, 11:24am UTC](https://discuss.elastic.co/t/error-with-indexexists/118220/1 "2018-02-02T11:24:22Z")

</div>

hi, im using nest v6 and it seems to be a bug or me doing something wrong..

when i follow this example:  
var request = new IndexExistsRequest(index);  
var result = client.IndexExists(request);  
i get this error:  
Elasticsearch.Net.UnexpectedElasticsearchClientException : Object reference not set to an instance of an object.  
---- System.NullReferenceException : Object reference not set to an instance of an object.  
at Elasticsearch.Net.Transport`1.Request[TResponse](HttpMethod method, String path, PostData data, IRequestParameters requestParameters) in c:\Projects\elastic\net-master\src\Elasticsearch.Net\Transport\Transport.cs:line 86 at Elasticsearch.Net.ElasticLowLevelClient.IndicesExists[TResponse](String index, IndexExistsRequestParameters requestParameters) in c:\Projects\elastic\net-master\src\Elasticsearch.Net\ElasticLowLevelClient.Generated.cs:line 1164 at Nest.LowLevelDispatch.IndicesExistsDispatch[TResponse](IRequest`1 p)  
at Nest.ElasticClient.Nest.IHighLevelToLowLevelDispatcher.Dispatch[TRequest,TQueryString,TResponse](TRequest request, Func`3 responseGenerator, Func`3 dispatch)  
at Everest.SystemLog.ElasticLogger.GetOrCreateIndex(ElasticClient client, String index)  
at Everest.SystemLog.ElasticLogger.LogEntry[T](LogLevels chiLogLevel, String docId, T entry)  
at Everest.SystemLog.LogServices.Log[T](LogLevels chiLogLevel, T entry, String docId)  
at SystemLog.Tests.LogTests.TestLoglevelErrorButFatalException() in C:\hrmanager\everest\SystemLog\test\LogTests.cs:line 90

but if i run it async, it works:  
var request = new IndexExistsRequest(index);  
var result = client.IndexExistsAsync(request).Result;

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [March 2, 2018, 11:24am UTC](https://discuss.elastic.co/t/error-with-indexexists/118220/2 "2018-03-02T11:24:27Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
