title: c# NullReferenceException in linq query
body: <p>In my code:</p>
  
  <pre><code>decimal maxPrice = list.Max(i =&gt; i.price);
  </code></pre>
  
  <p>Getting error - Object reference not set to an instance of an object.
  NullReferenceException was unhandled by code.</p>
  
  <p>The i value becomes null, though the list count is 6709. How do I resolve this?</p>