Canvas: fix possible crash with destroyed canvasses

This commit is contained in:
Thomas Geymayer 2014-06-01 12:00:07 +02:00
parent 8abe4622b9
commit 820a315cbe

View File

@ -76,7 +76,7 @@ namespace simgear
return PropertyBasedElementPtr();
BOOST_FOREACH(PropertyBasedElementPtr el, _elements)
if( el->getProps()->getStringValue("name") == name )
if( el && el->getProps()->getStringValue("name") == name )
return el;
return PropertyBasedElementPtr();