Skip to content
Browse files

Fix crash in raster readXml when data provide cannot be created

Actually it was a consequence of a broken test, but there
is no need to crash.
  • Loading branch information
elpaso committed Oct 31, 2018
1 parent bd71df0 commit 455b660e6bba1ecf62abe5c098ce75f9cc60f096
Showing with 6 additions and 0 deletions.
  1. +6 −0 src/core/raster/qgsrasterlayer.cpp
@@ -1491,6 +1491,12 @@ bool QgsRasterLayer::readXml( const QDomNode &layer_node, QgsReadWriteContext &c
QgsDataProvider::ProviderOptions providerOptions;
setDataProvider( mProviderKey, providerOptions );

if ( ! mDataProvider )
QgsDebugMsg( QStringLiteral( "Raster data provider could not be created for %1" ).arg( mDataSource ) );
return false;

QString error;
bool res = readSymbology( layer_node, error, context );

0 comments on commit 455b660

Please sign in to comment.
You can’t perform that action at this time.