title: NullReferenceException in LINQ Query
body: <p>I am getting an unusual "NullReferenceException was unhandled by user code" error in this LINQ query:</p>
  
  <pre><code>List&lt;UDIDInfo&gt; d2Android = d2.Where(x.DeviceOS == (byte)DeviceOS.Android).ToList();
  </code></pre>
  
  <p>I went ahead and added a null check and am still getting the error</p>
  
  <pre><code>List&lt;UDIDInfo&gt; d2Android = d2.Where(x =&gt; x.DeviceOS != null &amp;&amp; x.DeviceOS == (byte)DeviceOS.Android).ToList();
  </code></pre>
  
  <p>Note that <code>(byte)DeviceOS.Android</code> and <code>d2</code> are both not null </p>
  
  <p>Edit (Solution):</p>
  
  <pre><code>List&lt;UDIDInfo&gt; d2Android = d2.Where(x =&gt; x != null &amp;&amp; x.DeviceOS != null &amp;&amp; x.DeviceOS == (byte)DeviceOS.Android).ToList();
  </code></pre>