test geometry validity before applying offset

This commit is contained in:
Denis Rouzaud 2018-02-17 13:18:56 -04:00
parent b0bc2b20c7
commit cad45c0b80

View File

@ -300,7 +300,13 @@ void QgsMapToolOffsetCurve::applyOffset( const double &offset, const Qt::Keyboar
}
mModifiedGeometry = QgsGeometry::fromPolygonXY( newPoly );
}
}
if ( !mModifiedGeometry.isGeosValid() )
{
emit messageEmitted( tr( "Generated geometry is not valid." ), Qgis::Critical );
// no cancel, allow to continue editing.
return;
}
mLayer->beginEditCommand( tr( "Offset curve" ) );