Skip to content

Commit 09e1c8c

Browse files
committed
vector layer ctor: avoid 'Data source is invalid' warning when invoked with defaults
1 parent d315fdf commit 09e1c8c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/core/qgsvectorlayer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ QgsVectorLayer::QgsVectorLayer( const QString& vectorLayerPath,
159159
connect( mJoinBuffer, &QgsVectorLayerJoinBuffer::joinedFieldsChanged, this, &QgsVectorLayer::onJoinedFieldsChanged );
160160

161161
// if we're given a provider type, try to create and bind one to this layer
162-
if ( ! mProviderKey.isEmpty() )
162+
if ( !vectorLayerPath.isEmpty() && !mProviderKey.isEmpty() )
163163
{
164164
setDataSource( vectorLayerPath, baseName, providerKey, loadDefaultStyleFlag );
165165
}

0 commit comments

Comments
 (0)