Skip to content

Commit

Permalink
Merge pull request #5774 from pblottiere/bugfix_ref_rel_null
Browse files Browse the repository at this point in the history
[bugfix] Fixes crash in QgsRelationReferenceWidget
  • Loading branch information
pblottiere committed Dec 5, 2017
2 parents 1cd8b94 + 7c2732d commit aa68a9f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/gui/editorwidgets/qgsrelationreferencewidget.cpp
Expand Up @@ -267,7 +267,8 @@ void QgsRelationReferenceWidget::setForeignKey( const QVariant &value )

mReferencedLayer->getFeatures( request ).nextFeature( mFeature );

for ( int i = 0; i < mFilterFields.size(); i++ )
const int count = std::min( mFilterComboBoxes.size(), mFilterFields.size() );
for ( int i = 0; i < count; i++ )
{
QVariant v = mFeature.attribute( mFilterFields[i] );
QString f = v.isNull() ? nullValue.toString() : v.toString();
Expand Down

0 comments on commit aa68a9f

Please sign in to comment.