Skip to content

Commit 455b660

Browse files
committedNov 5, 2018
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.
1 parent bd71df0 commit 455b660

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed
 

‎src/core/raster/qgsrasterlayer.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1491,6 +1491,12 @@ bool QgsRasterLayer::readXml( const QDomNode &layer_node, QgsReadWriteContext &c
14911491
QgsDataProvider::ProviderOptions providerOptions;
14921492
setDataProvider( mProviderKey, providerOptions );
14931493

1494+
if ( ! mDataProvider )
1495+
{
1496+
QgsDebugMsg( QStringLiteral( "Raster data provider could not be created for %1" ).arg( mDataSource ) );
1497+
return false;
1498+
}
1499+
14941500
QString error;
14951501
bool res = readSymbology( layer_node, error, context );
14961502

0 commit comments

Comments
 (0)
Please sign in to comment.