tiny xml null point reference error when deserialize?
<p>I am working with C++. I have the following XML:</p>

<pre><code>&lt;data&gt;
&lt;name&gt; me&lt;/name&gt;
&lt;street /&gt;
&lt;/data&gt;
</code></pre>

<p>I want to deserialize this xml and i did:</p>

<pre><code>TiXMlDocument doc,
tiXmlHandle handle(&amp;doc)
TiXmlElement* sec;
sec=handle.FirstChild("data").FirstChild("name").element;
if (sec)
{ const char* str=sec-&gt;GetText();
}
</code></pre>

<p>And when i write:</p>

<pre><code>sec=handle.FirstChild("data").FirstChild("street").element;
if (sec)
{ const char* str=sec-&gt;GetText();  //here i have a null reference. pointer error. 
}
</code></pre>

<p>I need some help with that null pointer pointed out in the code above.</p>

<p>How can I resolve this?</p>
