mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-28 00:17:30 -05:00
Fix crash when trying to delete invalid curve from compound curves
This commit is contained in:
parent
840a9c104a
commit
cee1f56159
@ -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();
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user