a null reference error in c# return statement
<pre><code>public override bool Equals(object obj)
{
    var c = obj as myObj;
    if (c == null) return false;

    return   this.Id.Equals(c.Id)
        &amp;&amp; this.Email.Equals(c.Email)
        &amp;&amp; this.code.Equals(c.code)
        &amp;&amp; (this.myVal == null) ? true : (this.myVal.Equals(c.myVal))
}
</code></pre>

<p>This method as shown is supposed to return a boolean. When the value in "this.myVal" is null, I just want to return true (which I am doing above). Instead I get an
"Object reference not set to an instance of an object" caused in the check for this.myVal. This error indicates that the C# compiler does not care for my "null" check? Why should it complain about the null reference?</p>
