I have an IEnumerable that I run a foreach on. It's throwing a null reference exception in certain cases on the foreach line, it says
ienumerable threw an exception of type 'System.NullReferenceException
if (ienumerable != null)
{
foreach (var item in ienumerable)
{
......
}
}
I put in a null check before the foreach loop, and the iEnumerable passes the null check, but then when I run the foreach loop on it it throws the null reference exception.