mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-28 00:17:30 -05:00
Really fix adding parts to null geometry (fix #12885)
This commit is contained in:
parent
2d069c6645
commit
8286b1fe39
@ -181,7 +181,7 @@ int QgsVectorLayerEditUtils::addPart( const QList<QgsPoint> &points, QgsFeatureI
|
|||||||
if ( !L->getFeatures( QgsFeatureRequest().setFilterFid( featureId ).setSubsetOfAttributes( QgsAttributeList() ) ).nextFeature( f ) )
|
if ( !L->getFeatures( QgsFeatureRequest().setFilterFid( featureId ).setSubsetOfAttributes( QgsAttributeList() ) ).nextFeature( f ) )
|
||||||
return 6; //not found
|
return 6; //not found
|
||||||
|
|
||||||
if ( !f.constGeometry() )
|
if ( !f.constGeometry() || f.constGeometry()->isEmpty() )
|
||||||
{
|
{
|
||||||
//no existing geometry, so adding first part to null geometry
|
//no existing geometry, so adding first part to null geometry
|
||||||
firstPart = true;
|
firstPart = true;
|
||||||
@ -220,7 +220,7 @@ int QgsVectorLayerEditUtils::addPart( QgsCurveV2* ring, QgsFeatureId featureId )
|
|||||||
if ( !L->getFeatures( QgsFeatureRequest().setFilterFid( featureId ).setSubsetOfAttributes( QgsAttributeList() ) ).nextFeature( f ) )
|
if ( !L->getFeatures( QgsFeatureRequest().setFilterFid( featureId ).setSubsetOfAttributes( QgsAttributeList() ) ).nextFeature( f ) )
|
||||||
return 6; //not found
|
return 6; //not found
|
||||||
|
|
||||||
if ( !f.constGeometry() )
|
if ( !f.constGeometry() || f.constGeometry()->isEmpty() )
|
||||||
{
|
{
|
||||||
//no existing geometry, so adding first part to null geometry
|
//no existing geometry, so adding first part to null geometry
|
||||||
firstPart = true;
|
firstPart = true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user