Skip to content

Commit

Permalink
Really fix adding parts to null geometry (fix #12885)
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Oct 21, 2015
1 parent 2d069c6 commit 8286b1f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/qgsvectorlayereditutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ int QgsVectorLayerEditUtils::addPart( const QList<QgsPoint> &points, QgsFeatureI
if ( !L->getFeatures( QgsFeatureRequest().setFilterFid( featureId ).setSubsetOfAttributes( QgsAttributeList() ) ).nextFeature( f ) )
return 6; //not found

if ( !f.constGeometry() )
if ( !f.constGeometry() || f.constGeometry()->isEmpty() )
{
//no existing geometry, so adding first part to null geometry
firstPart = true;
Expand Down Expand Up @@ -220,7 +220,7 @@ int QgsVectorLayerEditUtils::addPart( QgsCurveV2* ring, QgsFeatureId featureId )
if ( !L->getFeatures( QgsFeatureRequest().setFilterFid( featureId ).setSubsetOfAttributes( QgsAttributeList() ) ).nextFeature( f ) )
return 6; //not found

if ( !f.constGeometry() )
if ( !f.constGeometry() || f.constGeometry()->isEmpty() )
{
//no existing geometry, so adding first part to null geometry
firstPart = true;
Expand Down

1 comment on commit 8286b1f

@m-kuhn
Copy link
Member

@m-kuhn m-kuhn commented on 8286b1f Oct 21, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Glad to have this finally solved. Thanks a lot!

Please sign in to comment.