mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-25 00:58:06 -05:00
make QgsMapLayerRegistry::addLayer() a bit more robust
git-svn-id: http://svn.osgeo.org/qgis/trunk@11961 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
parent
bd9186bdbf
commit
04e023c91b
@ -66,7 +66,7 @@ QgsMapLayer * QgsMapLayerRegistry::mapLayer( QString theLayerId )
|
|||||||
QgsMapLayer *
|
QgsMapLayer *
|
||||||
QgsMapLayerRegistry::addMapLayer( QgsMapLayer * theMapLayer, bool theEmitSignal )
|
QgsMapLayerRegistry::addMapLayer( QgsMapLayer * theMapLayer, bool theEmitSignal )
|
||||||
{
|
{
|
||||||
if ( !theMapLayer->isValid() )
|
if ( !theMapLayer || !theMapLayer->isValid() )
|
||||||
{
|
{
|
||||||
QgsDebugMsg( "cannot add invalid layers" );
|
QgsDebugMsg( "cannot add invalid layers" );
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user