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 Jun 6, 2016
1 parent 63b3eb7 commit c59350a170507cdbf563e44a28508cce3feeb2e9
Showing with 11 additions and 8 deletions.
  1. +11 −8 src/core/qgsofflineediting.cpp
@@ -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 );
}
}
}

0 comments on commit c59350a

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