Merge pull request #1457 from rouault/fix_crash_attr_table_no_attr_col

Fix crash when opening entity form from layer without attribute
This commit is contained in:
Matthias Kuhn 2014-06-18 12:37:07 +02:00
commit 4ded76f75f

View File

@ -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 );
}
}
}