Skip to content

Commit 8286b1f

Browse files
committedOct 21, 2015
Really fix adding parts to null geometry (fix #12885)
1 parent 2d069c6 commit 8286b1f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎src/core/qgsvectorlayereditutils.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ int QgsVectorLayerEditUtils::addPart( const QList<QgsPoint> &points, QgsFeatureI
181181
if ( !L->getFeatures( QgsFeatureRequest().setFilterFid( featureId ).setSubsetOfAttributes( QgsAttributeList() ) ).nextFeature( f ) )
182182
return 6; //not found
183183

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

223-
if ( !f.constGeometry() )
223+
if ( !f.constGeometry() || f.constGeometry()->isEmpty() )
224224
{
225225
//no existing geometry, so adding first part to null geometry
226226
firstPart = true;

0 commit comments

Comments
 (0)
Failed to load comments.