Skip to content

Commit 04e023c

Browse files
author
jef
committedNov 7, 2009
make QgsMapLayerRegistry::addLayer() a bit more robust
git-svn-id: http://svn.osgeo.org/qgis/trunk@11961 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent bd9186b commit 04e023c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎src/core/qgsmaplayerregistry.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ QgsMapLayer * QgsMapLayerRegistry::mapLayer( QString theLayerId )
6666
QgsMapLayer *
6767
QgsMapLayerRegistry::addMapLayer( QgsMapLayer * theMapLayer, bool theEmitSignal )
6868
{
69-
if ( !theMapLayer->isValid() )
69+
if ( !theMapLayer || !theMapLayer->isValid() )
7070
{
7171
QgsDebugMsg( "cannot add invalid layers" );
7272
return 0;

0 commit comments

Comments
 (0)
Please sign in to comment.