Checking for null property
<p>I want to check that a property on an array which is itself a child object is not null.</p>

<p>So i  have </p>

<pre><code>if (Parent.Child != null &amp;&amp; Parent.Child[0] != null &amp;&amp; Parent.Child[0].name != null)
var myName = Parent.Child[0].name
</code></pre>

<p>This seems like a very long winded way to get to the child[0].name whilst avoiding null reference exceptions. I am also getting index out of range errors. Is there a better way?</p>
