Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error object reference not set to an instance of an object

Status
Not open for further replies.

ahmedsa2018

Programmer
Apr 25, 2018
67
EG
I work on csharp i get error object reference not set to an instance of an object

code give me error

Error object reference not set to an instance of an object:
C#:
var Data = result.items.Select(e => new { PartID = e.create._id, IsUpdated = e.create.error != null && e.create.error.reason !=null && !e.create.error.reason.Contains("document already exists") ? 0 : 1, ErrorStatus = e.create.error == null  | (e.create.error.reason!=null && e.create.error.reason.Contains("document already exists")) ? null : e.create.error.reason }).ToList();




ElasticPartialUpdat.Create.error.get returned null.

so how to solve error please ?
 
how to use this to solve error
Object.ReferenceEquals(null, myObjVar)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top