We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
qgis
Learn more about funding links in repositories.
Report abuse
There was an error while loading. Please reload this page.
1 parent 68cfed9 commit c799812Copy full SHA for c799812
src/gui/editorwidgets/qgsrelationreferencewidget.cpp
@@ -351,7 +351,11 @@ QVariant QgsRelationReferenceWidget::foreignKey()
351
}
352
else
353
{
354
- if ( !mFeature.isValid() )
+ if ( mReferencingFieldIdx < 0 || mReferencingFieldIdx >= mReferencingLayer->fields().count() )
355
+ {
356
+ return QVariant();
357
+ }
358
+ else if ( !mFeature.isValid() )
359
360
return QVariant( mReferencingLayer->fields().at( mReferencingFieldIdx ).type() );
361
0 commit comments