File tree Expand file tree Collapse file tree 4 files changed +11
-7
lines changed Expand file tree Collapse file tree 4 files changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -284,7 +284,7 @@ class QgsVectorLayer : QgsMapLayer
284
284
/** Removes a vector layer join */
285
285
void removeJoin( const QString& joinLayerId );
286
286
287
- const QList< QgsVectorJoinInfo >& vectorJoins() const;
287
+ const QList< QgsVectorJoinInfo > vectorJoins() const;
288
288
289
289
/**
290
290
* Add a new field which is calculated by the expression specified
Original file line number Diff line number Diff line change @@ -1867,7 +1867,7 @@ QgsVectorFileWriter::WriterError QgsVectorFileWriter::writeAsVectorFormat( QgsVe
1867
1867
1868
1868
QGis::WkbType wkbType = layer->wkbType ();
1869
1869
1870
- if ( layer->providerType () == " ogr" )
1870
+ if ( layer->providerType () == " ogr" && layer-> dataProvider () )
1871
1871
{
1872
1872
QStringList theURIParts = layer->dataProvider ()->dataSourceUri ().split ( " |" );
1873
1873
QString srcFileName = theURIParts[0 ];
Original file line number Diff line number Diff line change @@ -2840,7 +2840,7 @@ int QgsVectorLayer::fieldNameIndex( const QString& fieldName ) const
2840
2840
2841
2841
bool QgsVectorLayer::addJoin ( const QgsVectorJoinInfo& joinInfo )
2842
2842
{
2843
- return mJoinBuffer ->addJoin ( joinInfo );
2843
+ return mJoinBuffer && mJoinBuffer ->addJoin ( joinInfo );
2844
2844
}
2845
2845
2846
2846
void QgsVectorLayer::checkJoinLayerRemove ( QString theLayerId )
@@ -2850,12 +2850,16 @@ void QgsVectorLayer::checkJoinLayerRemove( QString theLayerId )
2850
2850
2851
2851
void QgsVectorLayer::removeJoin ( const QString& joinLayerId )
2852
2852
{
2853
- mJoinBuffer ->removeJoin ( joinLayerId );
2853
+ if ( mJoinBuffer )
2854
+ mJoinBuffer ->removeJoin ( joinLayerId );
2854
2855
}
2855
2856
2856
- const QList< QgsVectorJoinInfo >& QgsVectorLayer::vectorJoins () const
2857
+ const QList< QgsVectorJoinInfo > QgsVectorLayer::vectorJoins () const
2857
2858
{
2858
- return mJoinBuffer ->vectorJoins ();
2859
+ if ( mJoinBuffer )
2860
+ return mJoinBuffer ->vectorJoins ();
2861
+ else
2862
+ return QList< QgsVectorJoinInfo >();
2859
2863
}
2860
2864
2861
2865
void QgsVectorLayer::addExpressionField ( const QString& exp, const QgsField& fld )
Original file line number Diff line number Diff line change @@ -647,7 +647,7 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer
647
647
/* * Removes a vector layer join */
648
648
void removeJoin ( const QString& joinLayerId );
649
649
650
- const QList< QgsVectorJoinInfo >& vectorJoins () const ;
650
+ const QList<QgsVectorJoinInfo> vectorJoins () const ;
651
651
652
652
/* *
653
653
* Add a new field which is calculated by the expression specified
You can’t perform that action at this time.
0 commit comments