Skip to content

Commit

Permalink
[offline editing] No reason to crash just because of raster layers
Browse files Browse the repository at this point in the history
Fix #14848
  • Loading branch information
m-kuhn committed Jul 11, 2016
1 parent 56514a7 commit 781d0c3
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions src/core/qgsofflineediting.cpp
Expand Up @@ -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 );
}
}
}

Expand Down

0 comments on commit 781d0c3

Please sign in to comment.