Skip to content
Permalink
Browse files

[offline editing] No reason to crash just because of raster layers

Fix #14848
  • Loading branch information
m-kuhn committed Jul 11, 2016
1 parent 56514a7 commit 781d0c359f9fe09df745ca45b776faec13beb8ed
Showing with 11 additions and 8 deletions.
  1. +11 −8 src/core/qgsofflineediting.cpp
@@ -134,15 +134,18 @@ bool QgsOfflineEditing::convertToOfflineProject( const QString& offlineDataPath,

QgsMapLayer* layer = QgsMapLayerRegistry::instance()->mapLayer( layerIds.at( i ) );
QgsVectorLayer* vl = qobject_cast<QgsVectorLayer*>( layer );
QString origLayerId = vl->id();
QgsVectorLayer* newLayer = copyVectorLayer( vl, db, dbPath );

if ( newLayer )
if ( vl )
{
layerIdMapping.insert( origLayerId, newLayer );
// remove remote layer
QgsMapLayerRegistry::instance()->removeMapLayers(
QStringList() << origLayerId );
QString origLayerId = vl->id();
QgsVectorLayer* newLayer = copyVectorLayer( vl, db, dbPath );

if ( newLayer )
{
layerIdMapping.insert( origLayerId, newLayer );
// remove remote layer
QgsMapLayerRegistry::instance()->removeMapLayers(
QStringList() << origLayerId );
}
}
}

0 comments on commit 781d0c3

Please sign in to comment.
You can’t perform that action at this time.