Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Check for nullptr layer
  • Loading branch information
YoannQDQ authored and nyalldawson committed Apr 6, 2023
1 parent 7ae70aa commit bf9f991
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/app/maptools/qgsmaptoolshapecircleabstract.cpp
Expand Up @@ -33,9 +33,13 @@ void QgsMapToolShapeCircleAbstract::addCircleToParentTool()
mParentTool->clearCurve();

// Check whether to draw the circle as a polygon or a circular string
const QgsCoordinateReferenceSystem layerCrs = mParentTool->layer()->crs();
const QgsCoordinateReferenceSystem mapCrs = mParentTool->canvas()->mapSettings().destinationCrs();
const bool drawAsPolygon = layerCrs != mapCrs;
bool drawAsPolygon = false;
if ( mParentTool->layer() )
{
const QgsCoordinateReferenceSystem layerCrs = mParentTool->layer()->crs();
const QgsCoordinateReferenceSystem mapCrs = mParentTool->canvas()->mapSettings().destinationCrs();
bool drawAsPolygon = layerCrs != mapCrs;
}
if ( drawAsPolygon )
{
const int segments = QgsSettingsRegistryCore::settingsDigitizingOffsetQuadSeg->value() * 12;
Expand Down

0 comments on commit bf9f991

Please sign in to comment.