Fix invalid model warning when opening an attribute table which contains no columns

This commit is contained in:
Nyall Dawson 2019-09-12 17:23:40 +10:00
parent 044e0d2512
commit 3144425caf

View File

@ -373,7 +373,7 @@ void QgsFeatureListView::ensureEditSelection( bool inSelection )
// could fall back to
bool validEditSelectionAvailable = false;
if ( selectedIndexes.isEmpty() || mModel->mapFromMaster( selectedIndexes.first() ).row() == -1 )
if ( selectedIndexes.isEmpty() || !selectedIndexes.first().isValid() || mModel->mapFromMaster( selectedIndexes.first() ).row() == -1 )
{
validEditSelectionAvailable = false;
}