Fix crash when trying to delete invalid curve from compound curves

This commit is contained in:
Nyall Dawson 2017-09-20 08:28:27 +10:00
parent 840a9c104a
commit cee1f56159

View File

@ -417,13 +417,12 @@ void QgsCompoundCurve::addCurve( QgsCurve *c )
void QgsCompoundCurve::removeCurve( int i )
{
if ( mCurves.size() - 1 < i )
if ( i < 0 || i >= mCurves.size() )
{
return;
}
delete ( mCurves.at( i ) );
mCurves.removeAt( i );
delete mCurves.takeAt( i );
clearCache();
}