Skip to content

Commit

Permalink
Check selection.indexes if empty before getting first() to avoid dang…
Browse files Browse the repository at this point in the history
…er of nullptr.
  • Loading branch information
signedav authored and github-actions[bot] committed Mar 7, 2023
1 parent 9798f8e commit a82a773
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/gui/attributetable/qgsfeaturelistview.cpp
Expand Up @@ -185,9 +185,13 @@ void QgsFeatureListView::editSelectionChanged( const QItemSelection &selected, c

if ( !selected.isEmpty() )
{
QgsFeature selectedFeature;
mModel->featureByIndex( mModel->mapFromMaster( selected.indexes().first() ), selectedFeature );
mLastEditSelectionFid = selectedFeature.id();
const QModelIndexList indexList = selected.indexes();
if ( !indexList.isEmpty() )
{
QgsFeature selectedFeature;
mModel->featureByIndex( mModel->mapFromMaster( indexList.first() ), selectedFeature );
mLastEditSelectionFid = selectedFeature.id();
}
}

const QItemSelection currentSelection = mCurrentEditSelectionModel->selection();
Expand Down

0 comments on commit a82a773

Please sign in to comment.