Prevent crash when fields are deleted from the vector options dialog

This commit is contained in:
Alessandro Pasotti 2019-02-20 10:10:59 +01:00
parent 4c8280a5f8
commit 76c6ec8c1a

View File

@ -277,7 +277,7 @@ void QgsAttributesFormProperties::loadAttributeTypeDialog()
void QgsAttributesFormProperties::storeAttributeTypeDialog()
{
if ( mAttributeTypeDialog->fieldIdx() < 0 )
if ( mAttributeTypeDialog->fieldIdx() < 0 || mAttributeTypeDialog->fieldIdx() >= mLayer->fields().count() )
return;
FieldConfig cfg;