I have a call like this,
SomeList.Fetch(x => SomeCondition).OrderBy(x => x.GetType().GetProperty(sort).GetValue(x, null))
I get an Object reference not set to an instance of an object at System.Object.GetType().
Any idea what might be causing this? This happens in-frequently and only in production.
Thanks.
If you want this to happen not in production but in development add a null item to your list via the Fetch. That’s the reason of the exception.