Skip to content

Commit 81cd2a5

Browse files
author
mhugent
committed
Added 0 pointer checks to saveAs
git-svn-id: http://svn.osgeo.org/qgis/trunk@13281 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 7d888d4 commit 81cd2a5

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

src/app/qgisapp.cpp

+18-4
Original file line numberDiff line numberDiff line change
@@ -3134,7 +3134,7 @@ void QgisApp::newSpatialiteLayer()
31343134
QString baseSQL;
31353135
if ( spatialiteDialog.includePrimaryKey() )
31363136
{
3137-
baseSQL = "create table %1(pkuid integer primary key autoincrement, ";
3137+
baseSQL = "create table %1(pkuid integer primary key autoincrement, ";
31383138
}
31393139
else
31403140
{
@@ -3911,12 +3911,26 @@ void QgisApp::attributeTable()
39113911

39123912
void QgisApp::saveAsVectorFile()
39133913
{
3914-
mMapLegend->currentLegendLayer()->saveAsVectorFile();
3914+
if ( mMapLegend )
3915+
{
3916+
QgsLegendLayer* currentLegendLayer = mMapLegend->currentLegendLayer();
3917+
if ( currentLegendLayer )
3918+
{
3919+
currentLegendLayer->saveAsVectorFile();
3920+
}
3921+
}
39153922
}
39163923

39173924
void QgisApp::saveSelectionAsVectorFile()
39183925
{
3919-
mMapLegend->currentLegendLayer()->saveSelectionAsVectorFile();
3926+
if ( mMapLegend )
3927+
{
3928+
QgsLegendLayer* currentLegendLayer = mMapLegend->currentLegendLayer();
3929+
if ( currentLegendLayer )
3930+
{
3931+
currentLegendLayer->saveSelectionAsVectorFile();
3932+
}
3933+
}
39203934
}
39213935

39223936
void QgisApp::layerProperties()
@@ -6720,7 +6734,7 @@ void QgisApp::namUpdate()
67206734
}
67216735

67226736
#if QT_VERSION >= 0x40500
6723-
if( !mProxyFactory )
6737+
if ( !mProxyFactory )
67246738
{
67256739
mProxyFactory = new QgsNetworkProxyFactory();
67266740
mNAM->setProxyFactory( mProxyFactory );

0 commit comments

Comments
 (0)