Skip to content

Commit

Permalink
make QgsMapLayerRegistry::addLayer() a bit more robust
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk@11961 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Nov 7, 2009
1 parent bd9186b commit 04e023c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/qgsmaplayerregistry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 04e023c

Please sign in to comment.