Skip to content

Commit

Permalink
Fix crash in raster readXml when data provide cannot be created
Browse files Browse the repository at this point in the history
Actually it was a consequence of a broken test, but there
is no need to crash.
  • Loading branch information
elpaso committed Nov 5, 2018
1 parent bd71df0 commit 455b660
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/core/raster/qgsrasterlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );

Expand Down

0 comments on commit 455b660

Please sign in to comment.