title: IEnumerable not null, but throwing a NullReferenceException on iteration
body: <p>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 </p>
  
  <blockquote>
    <p>ienumerable threw an exception of type 'System.NullReferenceException</p>
  </blockquote>
  
  <pre><code>if (ienumerable != null)
  {
      foreach (var item in ienumerable)
      {
          ......
      }
  }
  </code></pre>
  
  <p>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.</p>