Skip to content
Permalink
Browse files

Fix crash when adding feature to non-spatial layer

  • Loading branch information
m-kuhn committed Sep 12, 2018
1 parent 85ff90f commit 2182e2d9aaf3a8dd6447115a612f1c8e19f008cc
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/gui/qgsmaptooladvanceddigitizing.cpp
@@ -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() );
}
@@ -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() );

0 comments on commit 2182e2d

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