title: Object reference not set to an instance while not being null
body: <p>I'm getting some unexpected behavior in my process. I'm doing the following.</p>
  
  <pre><code>IEnumerable&lt;Thing&gt; things = ...;
  IEnumerable&lt;Thing&gt; subset = things.Where(a =&gt; a.SomeFlag);
  String info = "null: " + (subset == null);
  </code></pre>
  
  <p>The above works and <em>info</em> tells me that the object isn't <em>null</em>. So I wish to check the number of the elements in <em>subset</em> by this.</p>
  
  <pre><code>IEnumerable&lt;Thing&gt; things = ...;
  IEnumerable&lt;Thing&gt; subset = things.Where(a =&gt; a.SomeFlag);
  String info = "null: " + (subset == null);
  String count = subset.Count();
  </code></pre>
  
  <p>Now I get an exception giving me the error message:</p>
  
  <blockquote>
    <p>Object reference not set to an instance of an object. </p>
  </blockquote>
  
  <p>What do I miss?!</p>