Skip to content

Commit

Permalink
Do not crash after fixing invalid geometries
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Mar 18, 2019
1 parent bd44dce commit 5f4308c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/app/qgsgeometryvalidationmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,12 +191,18 @@ QVariant QgsGeometryValidationModel::data( const QModelIndex &index, int role )

case ErrorLocationGeometryRole:
{
if ( featureItem.errors.empty() )
return QVariant();

QgsSingleGeometryCheckError *error = featureItem.errors.first().get();
return error->errorLocation();
}

case ProblemExtentRole:
{
if ( featureItem.errors.empty() )
return QVariant();

QgsSingleGeometryCheckError *error = featureItem.errors.first().get();
return error->errorLocation().boundingBox();
}
Expand Down

0 comments on commit 5f4308c

Please sign in to comment.