We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents cd509e6 + 974fe95 commit 46f208fCopy full SHA for 46f208f
src/app/qgsmaptooladdfeature.cpp
@@ -226,7 +226,6 @@ void QgsMapToolAddFeature::canvasReleaseEvent( QMouseEvent * e )
226
}
227
else // polygon
228
{
229
- QgsGeometry *g;
230
if ( layerWKBType == QGis::WKBPolygon || layerWKBType == QGis::WKBPolygon25D )
231
232
g = QgsGeometry::fromPolygon( QgsPolygon() << points().toVector() );
@@ -242,6 +241,11 @@ void QgsMapToolAddFeature::canvasReleaseEvent( QMouseEvent * e )
242
241
return; //unknown wkbtype
243
244
+ if ( !g )
245
+ {
246
+ stopCapturing();
247
+ return; // invalid geometry; one possibility is from duplicate points
248
+ }
249
f->setGeometry( g );
250
251
int avoidIntersectionsReturn = f->geometry()->avoidIntersections();
0 commit comments