Skip to content

Commit

Permalink
Don't crash, please
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Aug 24, 2018
1 parent 308b16b commit 79f766a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions src/core/qgsrelation.cpp
Expand Up @@ -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 )
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsrelation_p.h
Expand Up @@ -39,7 +39,7 @@
class QgsRelationPrivate : public QSharedData
{
public:
QgsRelationPrivate();
QgsRelationPrivate() = default;

//! Unique Id
QString mRelationId;
Expand Down

0 comments on commit 79f766a

Please sign in to comment.