File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Expand file tree Collapse file tree 2 files changed +8
-4
lines changed 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 @@ -2858,7 +2858,7 @@ int QgsVectorLayer::fieldNameIndex( const QString& fieldName ) const
2858
2858
2859
2859
bool QgsVectorLayer::addJoin ( const QgsVectorJoinInfo& joinInfo )
2860
2860
{
2861
- return mJoinBuffer ->addJoin ( joinInfo );
2861
+ return mJoinBuffer && mJoinBuffer ->addJoin ( joinInfo );
2862
2862
}
2863
2863
2864
2864
void QgsVectorLayer::checkJoinLayerRemove ( QString theLayerId )
@@ -2868,12 +2868,16 @@ void QgsVectorLayer::checkJoinLayerRemove( QString theLayerId )
2868
2868
2869
2869
void QgsVectorLayer::removeJoin ( const QString& joinLayerId )
2870
2870
{
2871
- mJoinBuffer ->removeJoin ( joinLayerId );
2871
+ if ( mJoinBuffer )
2872
+ mJoinBuffer ->removeJoin ( joinLayerId );
2872
2873
}
2873
2874
2874
2875
const QList< QgsVectorJoinInfo >& QgsVectorLayer::vectorJoins () const
2875
2876
{
2876
- return mJoinBuffer ->vectorJoins ();
2877
+ if ( mJoinBuffer )
2878
+ return mJoinBuffer ->vectorJoins ();
2879
+ else
2880
+ return QList< QgsVectorJoinInfo >();
2877
2881
}
2878
2882
2879
2883
int QgsVectorLayer::addExpressionField ( const QString& exp, const QgsField& fld )
You can’t perform that action at this time.
0 commit comments