diff --git a/src/app/qgsattributesformproperties.cpp b/src/app/qgsattributesformproperties.cpp index 5770b12007f..5d3c68792ba 100644 --- a/src/app/qgsattributesformproperties.cpp +++ b/src/app/qgsattributesformproperties.cpp @@ -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;