Skip to content
Permalink
Browse files

Really fix adding parts to null geometry (fix #12885)

  • Loading branch information
nyalldawson committed Oct 21, 2015
1 parent 2d069c6 commit 8286b1fe39b11be7e92b08532be91b2f68cc0ef6
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/core/qgsvectorlayereditutils.cpp
@@ -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;
@@ -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;

1 comment on commit 8286b1f

@m-kuhn

This comment has been minimized.

Copy link
Member

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

Glad to have this finally solved. Thanks a lot!

Please sign in to comment.
You can’t perform that action at this time.