Skip to content
Permalink
Browse files
Fix potential crash when QgsMapToolCapture is used with a non-vector …
…layer
  • Loading branch information
nyalldawson committed Sep 8, 2021
1 parent e7faf95 commit f2776d947d74d4640366168de972b0704fe829ee
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/gui/qgsmaptoolcapture.cpp
@@ -288,7 +288,7 @@ bool QgsMapToolCapture::tracingAddVertex( const QgsPointXY &point )
{
// If the tool and the layer support curves
QgsVectorLayer *vlayer = qobject_cast<QgsVectorLayer *>( mCanvas->currentLayer() );
if ( capabilities().testFlag( QgsMapToolCapture::Capability::SupportsCurves ) && vlayer->dataProvider()->capabilities().testFlag( QgsVectorDataProvider::Capability::CircularGeometries ) )
if ( vlayer && capabilities().testFlag( QgsMapToolCapture::Capability::SupportsCurves ) && vlayer->dataProvider()->capabilities().testFlag( QgsVectorDataProvider::Capability::CircularGeometries ) )
{
const QgsGeometry linear = QgsGeometry( mCaptureCurve.segmentize() );
const QgsGeometry curved = linear.convertToCurves(

0 comments on commit f2776d9

Please sign in to comment.