Skip to content

Commit

Permalink
compare pointers
Browse files Browse the repository at this point in the history
  • Loading branch information
signedav committed Sep 18, 2018
1 parent 8766216 commit dcca348
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/gui/editorwidgets/qgsrelationwidgetwrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,15 @@ void QgsRelationWidgetWrapper::setVisible( bool visible )

void QgsRelationWidgetWrapper::aboutToSave()
{
if ( !mRelation.isValid() || !widget() || !widget()->isVisible() || mRelation.referencingLayer()->name() == mRelation.referencedLayer()->name() )
if ( !mRelation.isValid() || !widget() || !widget()->isVisible() || mRelation.referencingLayer() == mRelation.referencedLayer() )
return;

// If the layer is already saved before, return
const QgsAttributeEditorContext *ctx = &context();
do
{
if ( ctx->relation().isValid() && ( ctx->relation().referencedLayer()->name() == mRelation.referencingLayer()->name()
|| ( mNmRelation.isValid() && ctx->relation().referencedLayer()->name() == mNmRelation.referencedLayer()->name() ) )
if ( ctx->relation().isValid() && ( ctx->relation().referencedLayer() == mRelation.referencingLayer()
|| ( mNmRelation.isValid() && ctx->relation().referencedLayer() == mNmRelation.referencedLayer() ) )
)
{
return;
Expand Down

0 comments on commit dcca348

Please sign in to comment.