Skip to content

Commit c799812

Browse files
committedApr 26, 2016
Fix crash in relation reference widget (fix #14732)
(cherry-picked from eed4ee)
1 parent 68cfed9 commit c799812

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed
 

‎src/gui/editorwidgets/qgsrelationreferencewidget.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,11 @@ QVariant QgsRelationReferenceWidget::foreignKey()
351351
}
352352
else
353353
{
354-
if ( !mFeature.isValid() )
354+
if ( mReferencingFieldIdx < 0 || mReferencingFieldIdx >= mReferencingLayer->fields().count() )
355+
{
356+
return QVariant();
357+
}
358+
else if ( !mFeature.isValid() )
355359
{
356360
return QVariant( mReferencingLayer->fields().at( mReferencingFieldIdx ).type() );
357361
}

0 commit comments

Comments
 (0)
Please sign in to comment.