Skip to content

Commit

Permalink
vector layer ctor: avoid 'Data source is invalid' warning when invoke…
Browse files Browse the repository at this point in the history
…d with defaults
  • Loading branch information
jef-n committed Mar 2, 2017
1 parent d315fdf commit 09e1c8c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/qgsvectorlayer.cpp
Expand Up @@ -159,7 +159,7 @@ QgsVectorLayer::QgsVectorLayer( const QString& vectorLayerPath,
connect( mJoinBuffer, &QgsVectorLayerJoinBuffer::joinedFieldsChanged, this, &QgsVectorLayer::onJoinedFieldsChanged );

// if we're given a provider type, try to create and bind one to this layer
if ( ! mProviderKey.isEmpty() )
if ( !vectorLayerPath.isEmpty() && !mProviderKey.isEmpty() )
{
setDataSource( vectorLayerPath, baseName, providerKey, loadDefaultStyleFlag );
}
Expand Down

0 comments on commit 09e1c8c

Please sign in to comment.