Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit e02a976

Browse files
YoannQDQgithub-actions[bot]
authored andcommittedApr 6, 2023
Check for nullptr layer
1 parent be2cd18 commit e02a976

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed
 

‎src/app/maptools/qgsmaptoolshapecircleabstract.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,13 @@ void QgsMapToolShapeCircleAbstract::addCircleToParentTool()
3333
mParentTool->clearCurve();
3434

3535
// 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+
}
3943
if ( drawAsPolygon )
4044
{
4145
const int segments = QgsSettingsRegistryCore::settingsDigitizingOffsetQuadSeg.value() * 12;

0 commit comments

Comments
 (0)
Please sign in to comment.