Skip to content
Permalink
Browse files
Merge pull request #98 from lynxlynxlynx/master
a crash fix and a tiny cleanup
  • Loading branch information
mhugent committed Feb 18, 2012
2 parents cd509e6 + 974fe95 commit 46f208fc22bed2920f33918fe31fffea73812b3b
Showing with 5 additions and 1 deletion.
  1. +5 −1 src/app/qgsmaptooladdfeature.cpp
@@ -226,7 +226,6 @@ void QgsMapToolAddFeature::canvasReleaseEvent( QMouseEvent * e )
}
else // polygon
{
QgsGeometry *g;
if ( layerWKBType == QGis::WKBPolygon || layerWKBType == QGis::WKBPolygon25D )
{
g = QgsGeometry::fromPolygon( QgsPolygon() << points().toVector() );
@@ -242,6 +241,11 @@ void QgsMapToolAddFeature::canvasReleaseEvent( QMouseEvent * e )
return; //unknown wkbtype
}

if ( !g )
{
stopCapturing();
return; // invalid geometry; one possibility is from duplicate points
}
f->setGeometry( g );

int avoidIntersectionsReturn = f->geometry()->avoidIntersections();

0 comments on commit 46f208f

Please sign in to comment.