Skip to content
Permalink
Browse files

make QgsMapLayerRegistry::addLayer() a bit more robust

git-svn-id: http://svn.osgeo.org/qgis/trunk@11961 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef
jef committed Nov 7, 2009
1 parent bd9186b commit 04e023c91becee03dba5cb7ecb99a754ef994076
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/core/qgsmaplayerregistry.cpp
@@ -66,7 +66,7 @@ QgsMapLayer * QgsMapLayerRegistry::mapLayer( QString theLayerId )
QgsMapLayer *
QgsMapLayerRegistry::addMapLayer( QgsMapLayer * theMapLayer, bool theEmitSignal )
{
if ( !theMapLayer->isValid() )
if ( !theMapLayer || !theMapLayer->isValid() )
{
QgsDebugMsg( "cannot add invalid layers" );
return 0;

0 comments on commit 04e023c

Please sign in to comment.
You can’t perform that action at this time.