Skip to content

Commit

Permalink
Fix crash when adding feature to non-spatial layer
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Sep 12, 2018
1 parent 85ff90f commit 2182e2d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/gui/qgsmaptooladvanceddigitizing.cpp
Expand Up @@ -83,7 +83,7 @@ void QgsMapToolAdvancedDigitizing::canvasReleaseEvent( QgsMapMouseEvent *e )
}

QgsVectorLayer *layer = currentVectorLayer();
if ( mSnapToLayerGridEnabled && layer )
if ( mSnapToGridCanvasItem && mSnapToLayerGridEnabled && layer )
{
e->snapToGrid( layer->geometryFixes()->geometryPrecision(), layer->crs() );
}
Expand All @@ -108,7 +108,7 @@ void QgsMapToolAdvancedDigitizing::canvasMoveEvent( QgsMapMouseEvent *e )
}

QgsVectorLayer *layer = currentVectorLayer();
if ( mSnapToLayerGridEnabled && layer )
if ( mSnapToGridCanvasItem && mSnapToLayerGridEnabled && layer )
{
e->snapToGrid( layer->geometryFixes()->geometryPrecision(), layer->crs() );
mSnapToGridCanvasItem->setPoint( e->mapPoint() );
Expand Down

0 comments on commit 2182e2d

Please sign in to comment.