Skip to content

Commit eed4ee6

Browse files
committedApr 26, 2016
Fix crash in relation reference widget (fix #14732)
1 parent f01c57a commit eed4ee6

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
@@ -365,7 +365,11 @@ QVariant QgsRelationReferenceWidget::foreignKey()
365365
}
366366
else
367367
{
368-
if ( !mFeature.isValid() )
368+
if ( mReferencingFieldIdx < 0 || mReferencingFieldIdx >= mReferencingLayer->fields().count() )
369+
{
370+
return QVariant();
371+
}
372+
else if ( !mFeature.isValid() )
369373
{
370374
return QVariant( mReferencingLayer->fields().at( mReferencingFieldIdx ).type() );
371375
}

0 commit comments

Comments
 (0)
Please sign in to comment.