[QGIS Commit] r13281 - trunk/qgis/src/app

svn_qgis at osgeo.org svn_qgis at osgeo.org
Thu Apr 8 05:43:48 EDT 2010


Author: mhugent
Date: 2010-04-08 05:43:46 -0400 (Thu, 08 Apr 2010)
New Revision: 13281

Modified:
   trunk/qgis/src/app/qgisapp.cpp
Log:
Added 0 pointer checks to saveAs

Modified: trunk/qgis/src/app/qgisapp.cpp
===================================================================
--- trunk/qgis/src/app/qgisapp.cpp	2010-04-08 05:20:36 UTC (rev 13280)
+++ trunk/qgis/src/app/qgisapp.cpp	2010-04-08 09:43:46 UTC (rev 13281)
@@ -3134,7 +3134,7 @@
   QString baseSQL;
   if ( spatialiteDialog.includePrimaryKey() )
   {
-    baseSQL = "create table %1(pkuid integer primary key autoincrement, "; 
+    baseSQL = "create table %1(pkuid integer primary key autoincrement, ";
   }
   else
   {
@@ -3911,12 +3911,26 @@
 
 void QgisApp::saveAsVectorFile()
 {
-  mMapLegend->currentLegendLayer()->saveAsVectorFile();
+  if ( mMapLegend )
+  {
+    QgsLegendLayer* currentLegendLayer = mMapLegend->currentLegendLayer();
+    if ( currentLegendLayer )
+    {
+      currentLegendLayer->saveAsVectorFile();
+    }
+  }
 }
 
 void QgisApp::saveSelectionAsVectorFile()
 {
-  mMapLegend->currentLegendLayer()->saveSelectionAsVectorFile();
+  if ( mMapLegend )
+  {
+    QgsLegendLayer* currentLegendLayer = mMapLegend->currentLegendLayer();
+    if ( currentLegendLayer )
+    {
+      currentLegendLayer->saveSelectionAsVectorFile();
+    }
+  }
 }
 
 void QgisApp::layerProperties()
@@ -6720,7 +6734,7 @@
   }
 
 #if QT_VERSION >= 0x40500
-  if( !mProxyFactory )
+  if ( !mProxyFactory )
   {
     mProxyFactory = new QgsNetworkProxyFactory();
     mNAM->setProxyFactory( mProxyFactory );



More information about the QGIS-commit mailing list