title: nullable bool in if() statement - checks required?
body: <p>I just came across this in a coworkers code. He has a nullable bool type that he compares like this:</p>
  
  <pre><code>//foo has no value here and evaluated to false
  if(foo==true)
  {
      doSomething();
  }
  </code></pre>
  
  <p>Typically, the way I check a nullable boolean is something like this:</p>
  
  <pre><code>bool IsTrue(bool? value)
  {
     return value.HasValue &amp;&amp; value.Value;
  }
  
  if(IsTrue(foo)){
     doSomething()
  }
  </code></pre>
  
  <p><strong>Edit: I ran through both methods and they both appear work the same way. I'm asking which one is the correct way and if the extra checks are necessary??</strong></p>
  
  <p>Now I am questioning both myself and my coworkers code. Is there any point in me doing this extra check here? Or can I safely do it the first way? </p>
  
  <p>Thanks (and yes I did search for this! :))</p>