title: Check for null in foreach loop
body: <p>Is there a nicer way of doing the following:<br>
  I need a check for null to happen on file.Headers before proceeding with the loop  </p>
  
  <pre><code>if (file.Headers != null)
  {
    foreach (var h in file.Headers)
    {
     //set lots of properties &amp; some other stuff
    }
  }
  </code></pre>
  
  <p>In short it looks a bit ugly to write the foreach inside the if due to the level of indentation happening in my code.</p>
  
  <p>Is something that would evaluate to </p>
  
  <pre><code>foreach(var h in (file.Headers != null))
  {
    //do stuff
  }
  </code></pre>
  
  <p>possible?</p>