Skip to content

Commit

Permalink
Merge pull request #98 from lynxlynxlynx/master
Browse files Browse the repository at this point in the history
a crash fix and a tiny cleanup
  • Loading branch information
mhugent committed Feb 18, 2012
2 parents cd509e6 + 974fe95 commit 46f208f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/app/qgsmaptooladdfeature.cpp
Expand Up @@ -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() );
Expand All @@ -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();
Expand Down

0 comments on commit 46f208f

Please sign in to comment.