Skip to content

Commit 2182e2d

Browse files
committedSep 12, 2018
Fix crash when adding feature to non-spatial layer
1 parent 85ff90f commit 2182e2d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎src/gui/qgsmaptooladvanceddigitizing.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ void QgsMapToolAdvancedDigitizing::canvasReleaseEvent( QgsMapMouseEvent *e )
8383
}
8484

8585
QgsVectorLayer *layer = currentVectorLayer();
86-
if ( mSnapToLayerGridEnabled && layer )
86+
if ( mSnapToGridCanvasItem && mSnapToLayerGridEnabled && layer )
8787
{
8888
e->snapToGrid( layer->geometryFixes()->geometryPrecision(), layer->crs() );
8989
}
@@ -108,7 +108,7 @@ void QgsMapToolAdvancedDigitizing::canvasMoveEvent( QgsMapMouseEvent *e )
108108
}
109109

110110
QgsVectorLayer *layer = currentVectorLayer();
111-
if ( mSnapToLayerGridEnabled && layer )
111+
if ( mSnapToGridCanvasItem && mSnapToLayerGridEnabled && layer )
112112
{
113113
e->snapToGrid( layer->geometryFixes()->geometryPrecision(), layer->crs() );
114114
mSnapToGridCanvasItem->setPoint( e->mapPoint() );

0 commit comments

Comments
 (0)
Please sign in to comment.