Skip to content

Commit

Permalink
Fix crash in QgsCompoundCurve equality operator
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Sep 19, 2017
1 parent 1540448 commit e6a0af5
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/core/geometry/qgscompoundcurve.cpp
Expand Up @@ -41,7 +41,19 @@ bool QgsCompoundCurve::operator==( const QgsCurve &other ) const
if ( !otherCurve )
return false;

return *otherCurve == *this;
if ( mWkbType != otherCurve->mWkbType )
return false;

if ( mCurves.size() != otherCurve->mCurves.size() )
return false;

for ( int i = 0; i < mCurves.size(); ++i )
{
if ( *mCurves.at( i ) != *otherCurve->mCurves.at( i ) )
return false;
}

return true;
}

bool QgsCompoundCurve::operator!=( const QgsCurve &other ) const
Expand Down

0 comments on commit e6a0af5

Please sign in to comment.