[QGIS Commit] r11961 - trunk/qgis/src/core

svn_qgis at osgeo.org svn_qgis at osgeo.org
Sat Nov 7 11:51:32 EST 2009


Author: jef
Date: 2009-11-07 11:51:31 -0500 (Sat, 07 Nov 2009)
New Revision: 11961

Modified:
   trunk/qgis/src/core/qgsmaplayerregistry.cpp
Log:
make QgsMapLayerRegistry::addLayer() a bit more robust

Modified: trunk/qgis/src/core/qgsmaplayerregistry.cpp
===================================================================
--- trunk/qgis/src/core/qgsmaplayerregistry.cpp	2009-11-07 16:50:40 UTC (rev 11960)
+++ trunk/qgis/src/core/qgsmaplayerregistry.cpp	2009-11-07 16:51:31 UTC (rev 11961)
@@ -66,7 +66,7 @@
 QgsMapLayer *
 QgsMapLayerRegistry::addMapLayer( QgsMapLayer * theMapLayer, bool theEmitSignal )
 {
-  if ( !theMapLayer->isValid() )
+  if ( !theMapLayer || !theMapLayer->isValid() )
   {
     QgsDebugMsg( "cannot add invalid layers" );
     return 0;



More information about the QGIS-commit mailing list