Skip to content
Permalink
Browse files

Don't crash, please

  • Loading branch information
m-kuhn committed Aug 24, 2018
1 parent 308b16b commit 79f766afef935f1e54b0dcd46e1807d04cec9897
Showing with 4 additions and 5 deletions.
  1. +3 −4 src/core/qgsrelation.cpp
  2. +1 −1 src/core/qgsrelation_p.h
@@ -23,12 +23,11 @@
#include "qgsrelation_p.h"

QgsRelation::QgsRelation()
: d( new QgsRelationPrivate() )
{
}

QgsRelation::~QgsRelation()
{
}
QgsRelation::~QgsRelation() = default;

QgsRelation::QgsRelation( const QgsRelation &other )
: d( other.d )
@@ -326,7 +325,7 @@ QgsAttributeList QgsRelation::referencingFields() const

bool QgsRelation::isValid() const
{
return d->mValid && d->mReferencingLayer && d->mReferencedLayer;
return d->mValid && !d->mReferencingLayer.isNull() && !d->mReferencedLayer.isNull();
}

bool QgsRelation::hasEqualDefinition( const QgsRelation &other ) const
@@ -39,7 +39,7 @@
class QgsRelationPrivate : public QSharedData
{
public:
QgsRelationPrivate();
QgsRelationPrivate() = default;

//! Unique Id
QString mRelationId;

0 comments on commit 79f766a

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