Skip to content
Permalink
Browse files

"Fix" crash in attribute table field calculator

  • Loading branch information
nyalldawson committed Feb 22, 2018
1 parent 3ed98f1 commit 2973e85f1d75480735e11e7221207caf3c76657d
Showing with 7 additions and 0 deletions.
  1. +7 −0 src/app/qgsattributetabledialog.cpp
@@ -495,6 +495,13 @@ void QgsAttributeTableDialog::runFieldCalculation( QgsVectorLayer *layer, const
mLayer->beginEditCommand( QStringLiteral( "Field calculator" ) );

int fieldindex = layer->fields().indexFromName( fieldName );
if ( fieldindex < 0 )
{
// this shouldn't happen... but it did. There's probably some deeper underlying issue
// but we may as well play it safe here.
QMessageBox::critical( nullptr, tr( "Update Attributes" ), tr( "An error occurred while trying to update the field %1" ).arg( fieldName ) );
return;
}

bool calculationSuccess = true;
QString error;

0 comments on commit 2973e85

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