File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -33,9 +33,13 @@ void QgsMapToolShapeCircleAbstract::addCircleToParentTool()
33
33
mParentTool ->clearCurve ();
34
34
35
35
// Check whether to draw the circle as a polygon or a circular string
36
- const QgsCoordinateReferenceSystem layerCrs = mParentTool ->layer ()->crs ();
37
- const QgsCoordinateReferenceSystem mapCrs = mParentTool ->canvas ()->mapSettings ().destinationCrs ();
38
- const bool drawAsPolygon = layerCrs != mapCrs;
36
+ bool drawAsPolygon = false ;
37
+ if ( mParentTool ->layer () )
38
+ {
39
+ const QgsCoordinateReferenceSystem layerCrs = mParentTool ->layer ()->crs ();
40
+ const QgsCoordinateReferenceSystem mapCrs = mParentTool ->canvas ()->mapSettings ().destinationCrs ();
41
+ bool drawAsPolygon = layerCrs != mapCrs;
42
+ }
39
43
if ( drawAsPolygon )
40
44
{
41
45
const int segments = QgsSettingsRegistryCore::settingsDigitizingOffsetQuadSeg.value () * 12 ;
You can’t perform that action at this time.
0 commit comments