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 Jun 6, 2016
1 parent 63b3eb7 commit c59350a
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions src/core/qgsofflineediting.cpp
Expand Up @@ -136,15 +136,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 c59350a

Please sign in to comment.