Skip to content

Commit

Permalink
Fix crash when using select by expression from attribute table dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Jan 17, 2019
1 parent 9014be0 commit 00c4d4a
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/gui/qgsexpressionselectiondialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,19 +134,23 @@ void QgsExpressionSelectionDialog::mActionRemoveFromSelection_triggered()

void QgsExpressionSelectionDialog::pushSelectedFeaturesMessage()
{
int count = mLayer->selectedFeatureCount();
if ( !mMessageBar )
return;

const int timeout = QgsSettings().value( QStringLiteral( "qgis/messageTimeout" ), 5 ).toInt();
const int count = mLayer->selectedFeatureCount();
if ( count > 0 )
{
mMessageBar->pushMessage( QString(),
tr( "%1 matching %2 selected" ).arg( count )
.arg( count == 1 ? tr( "feature" ) : tr( "features" ) ),
Qgis::Info );
Qgis::Info, timeout );
}
else
{
mMessageBar->pushMessage( QString(),
tr( "No matching features found" ),
Qgis::Warning );
Qgis::Warning, timeout );
}
}

Expand Down

0 comments on commit 00c4d4a

Please sign in to comment.