title: Nullable object must have a value - why?
body: <p>I have the following LINQ query</p>
  
  <pre><code>from p in dc.Purchases
  where invoiceNumber == null || p.InvNumber == invoiceNumber.Value
  select p;
  </code></pre>
  
  <p>The 'invoiceNumber' is a nullable int - when it's null, the program throws a 'Nullable object must have a value error'. Why is this when it's explicitly checking if it's null first? Is there a way around this?</p>
  
  <p>Thanks, </p>