mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-28 00:17:30 -05:00
Fix crash in relation reference widget (fix #14732)
This commit is contained in:
parent
f01c57af6a
commit
eed4ee6411
@ -365,7 +365,11 @@ QVariant QgsRelationReferenceWidget::foreignKey()
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( !mFeature.isValid() )
|
||||
if ( mReferencingFieldIdx < 0 || mReferencingFieldIdx >= mReferencingLayer->fields().count() )
|
||||
{
|
||||
return QVariant();
|
||||
}
|
||||
else if ( !mFeature.isValid() )
|
||||
{
|
||||
return QVariant( mReferencingLayer->fields().at( mReferencingFieldIdx ).type() );
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user