Skip to content

Commit

Permalink
[xyz] Don't crash on empty tilesets, instead return empty images
Browse files Browse the repository at this point in the history
This situation can validly arise e.g. if a user puts in a greater min
tile zoom level then is actually available
  • Loading branch information
nyalldawson committed Jul 7, 2019
1 parent 9345e9e commit 900d970
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/providers/wms/qgswmsprovider.cpp
Expand Up @@ -652,7 +652,11 @@ QImage *QgsWmsProvider::draw( QgsRectangle const &viewExtent, int pixelWidth, in
{
Q_ASSERT( mTileLayer );
Q_ASSERT( mTileMatrixSet );
Q_ASSERT( !mTileMatrixSet->tileMatrices.isEmpty() );
if ( mTileMatrixSet->tileMatrices.isEmpty() )
{
QgsDebugMsg( QStringLiteral( "WMTS tile set is empty!" ) );
return image;
}

// if we know both source and output DPI, let's scale the tiles
if ( mDpi != -1 && mTileLayer->dpi != -1 )
Expand Down

0 comments on commit 900d970

Please sign in to comment.