Skip to content
Permalink
Browse files

Merge pull request #5774 from pblottiere/bugfix_ref_rel_null

[bugfix] Fixes crash in QgsRelationReferenceWidget
  • Loading branch information
pblottiere committed Dec 5, 2017
2 parents 1cd8b94 + 7c2732d commit aa68a9faec920f869cc0691d1e5fbc5687b2ebea
Showing with 2 additions and 1 deletion.
  1. +2 −1 src/gui/editorwidgets/qgsrelationreferencewidget.cpp
@@ -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();

0 comments on commit aa68a9f

Please sign in to comment.
You can’t perform that action at this time.