Skip to content

Commit

Permalink
Fix check condition for layer style restore
Browse files Browse the repository at this point in the history
  • Loading branch information
elpaso committed Nov 5, 2018
1 parent 4481127 commit 70d9b6c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/app/qgisapp.cpp
Expand Up @@ -6955,7 +6955,7 @@ void QgisApp::changeDataSource( QgsMapLayer *layer )
bool layerIsValid( layer->isValid() );
layer->setDataSource( uri.uri, layer->name(), uri.providerKey, QgsDataProvider::ProviderOptions() );
// Re-apply style
if ( !( layerIsValid && layer->originalXmlProperties().isEmpty() ) )
if ( !( layerIsValid || layer->originalXmlProperties().isEmpty() ) )
{
QgsReadWriteContext context;
context.setPathResolver( QgsProject::instance()->pathResolver() );
Expand Down

0 comments on commit 70d9b6c

Please sign in to comment.