Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix crash when opening entity form from layer without attribute
When right-clicking in the attribute table of a layer that has
no attribute, no feature is selected. If selecting the 'Edit form'
entry, we got a crash.
  • Loading branch information
rouault committed Jun 16, 2014
1 parent 5eddb74 commit ec82076
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/gui/attributetable/qgsfeaturelistview.cpp
Expand Up @@ -144,10 +144,14 @@ void QgsFeatureListView::editSelectionChanged( QItemSelection deselected, QItemS
QItemSelection currentSelection = mCurrentEditSelectionModel->selection();
if ( currentSelection.size() == 1 )
{
QgsFeature feat;
mModel->featureByIndex( mModel->mapFromMaster( currentSelection.indexes().first() ), feat );
QModelIndexList indexList = currentSelection.indexes();
if ( !indexList.isEmpty() )
{
QgsFeature feat;
mModel->featureByIndex( mModel->mapFromMaster( indexList.first() ), feat );

emit currentEditSelectionChanged( feat );
emit currentEditSelectionChanged( feat );
}
}
}

Expand Down

0 comments on commit ec82076

Please sign in to comment.