Skip to content
Permalink
Browse files

Merge pull request #9191 from elpaso/bugfix-21259-geomchecker-crash

Geom checker plugin: don't crash if feedback is 0x0

cherry-picked from master commit 377040a
  • Loading branch information
elpaso committed Feb 18, 2019
1 parent df8a5c2 commit 2a04ba5078df6b2e7a79e2c2c93d27ef3106f9f2
@@ -45,7 +45,7 @@ void QgsGeometryGapCheck::collectErrors( const QMap<QString, QgsFeaturePool *> &
{
geomList.append( layerFeature.geometry().constGet()->clone() );

if ( feedback->isCanceled() )
if ( feedback && feedback->isCanceled() )
{
qDeleteAll( geomList );
geomList.clear();
@@ -43,7 +43,7 @@ void QgsGeometryMissingVertexCheck::collectErrors( const QMap<QString, QgsFeatur

for ( const QgsGeometryCheckerUtils::LayerFeature &layerFeature : layerFeatures )
{
if ( feedback->isCanceled() )
if ( feedback && feedback->isCanceled() )
{
break;
}
@@ -152,7 +152,7 @@ void QgsGeometryMissingVertexCheck::processPolygon( const QgsCurvePolygon *polyg

if ( featurePool->getFeature( fid, compareFeature, feedback ) )
{
if ( feedback->isCanceled() )
if ( feedback && feedback->isCanceled() )
break;

QgsVertexIterator vertexIterator = compareFeature.geometry().vertices();
@@ -35,7 +35,7 @@ void QgsGeometryOverlapCheck::collectErrors( const QMap<QString, QgsFeaturePool
QList<QString> layerIds = featureIds.keys();
for ( const QgsGeometryCheckerUtils::LayerFeature &layerFeatureA : layerFeaturesA )
{
if ( feedback->isCanceled() )
if ( feedback && feedback->isCanceled() )
break;

// Ensure each pair of layers only gets compared once: remove the current layer from the layerIds, but add it to the layerList for layerFeaturesB
@@ -52,7 +52,7 @@ void QgsGeometryOverlapCheck::collectErrors( const QMap<QString, QgsFeaturePool
const QgsGeometryCheckerUtils::LayerFeatures layerFeaturesB( featurePools, QList<QString>() << layerFeatureA.layer()->id() << layerIds, bboxA, compatibleGeometryTypes(), mContext );
for ( const QgsGeometryCheckerUtils::LayerFeature &layerFeatureB : layerFeaturesB )
{
if ( feedback->isCanceled() )
if ( feedback && feedback->isCanceled() )
break;

// > : only report overlaps within same layer once

0 comments on commit 2a04ba5

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