Skip to content

Commit

Permalink
fix crash when exporting check geometries gaps
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] authored and nyalldawson committed Feb 27, 2020
1 parent 34ddd20 commit 9b92216
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/plugins/geometry_checker/qgsgeometrycheckerresulttab.cpp
Expand Up @@ -278,9 +278,16 @@ bool QgsGeometryCheckerResultTab::exportErrorsDo( const QString &file )
for ( int row = 0, nRows = ui.tableWidgetErrors->rowCount(); row < nRows; ++row )
{
QgsGeometryCheckError *error = ui.tableWidgetErrors->item( row, 0 )->data( Qt::UserRole ).value<QgsGeometryCheckError *>();
QgsVectorLayer *srcLayer = mChecker->featurePools()[error->layerId()]->layer();
QString layerName = QString();
const QString layerId = error->layerId();
if ( mChecker->featurePools().keys().contains( layerId ) )
{
QgsVectorLayer *srcLayer = mChecker->featurePools()[layerId]->layer();
layerName = srcLayer->name();
}

QgsFeature f( layer->fields() );
f.setAttribute( fieldLayer, srcLayer->name() );
f.setAttribute( fieldLayer, layerName );
f.setAttribute( fieldFeatureId, error->featureId() );
f.setAttribute( fieldErrDesc, error->description() );
QgsGeometry geom( new QgsPoint( error->location() ) );
Expand Down

0 comments on commit 9b92216

Please sign in to comment.