Skip to content

Commit

Permalink
keep old value when asked to set an invalid value in relation ref widget
Browse files Browse the repository at this point in the history
  • Loading branch information
SebDieBln committed Feb 25, 2016
1 parent 5f157a9 commit cc19a57
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/gui/editorwidgets/qgsrelationreferencewidget.cpp
Expand Up @@ -234,7 +234,11 @@ void QgsRelationReferenceWidget::setRelationEditable( bool editable )

void QgsRelationReferenceWidget::setForeignKey( const QVariant& value )
{
if ( !value.isValid() || value.isNull() )
if ( !value.isValid() )
{
return;
}
if ( value.isNull() )
{
deleteForeignKey();
return;
Expand All @@ -254,7 +258,6 @@ void QgsRelationReferenceWidget::setForeignKey( const QVariant& value )

if ( !mFeature.isValid() )
{
deleteForeignKey();
return;
}

Expand Down

0 comments on commit cc19a57

Please sign in to comment.