Hi Jef,<br><br><div class="gmail_quote">On Fri, May 28, 2010 at 1:09 PM, Jürgen E. <span dir="ltr">&lt;<a href="mailto:jef@norbit.de">jef@norbit.de</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

<div class="im">
&gt;    without any changes to that code, now QGis doesn&#39;t crash more if<br>
&gt;    I drop a layer in an invalid place.<br>
<br>
</div>On Fri, 28. May 2010 at 11:28:45 +0200, Giuseppe Sucameli wrote:<br>I don&#39;t think dynamic_cast on null pointers are bad.  But all should be<br>
accompanied with a test for the result.  In qgslegend there are several places<br>
where the result is not checked before dereferencing it.  For instance line<br>
266 and 326 - but not in your quoted code.<br></blockquote><div>I agree with you, it&#39;s strange without dereferencing.<br>But I added some debug message to understand where QGis crashed and the <br>line was the same of the dynamic_cast.<br>

</div></div>BTW now works fine.<br><br>Cheers<br clear="all"><br>-- <br>Giuseppe Sucameli<br>