title: Deep null checking, is there a better way?
body: <p><strong>Note:</strong> This question was asked before the introduction of <a href="https://msdn.microsoft.com/en-us/library/dn986595.aspx" rel="noreferrer">the <code>.?</code> operator in C# 6 / Visual Studio 2015</a>.</p>
  
  <p>We've all been there, we have some deep property like cake.frosting.berries.loader that we need to check if it's null so there's no exception. The way to do is is to use a short-circuiting if statement</p>
  
  <pre><code>if (cake != null &amp;&amp; cake.frosting != null &amp;&amp; cake.frosting.berries != null) ...
  </code></pre>
  
  <p>This is not exactly elegant, and there should perhaps be an  easier way to check the entire chain and see if it comes up against a null variable/property. </p>
  
  <p>Is it possible using some extension method or would it be a language feature, or is it just a bad idea?</p>