Skip to content

Commit

Permalink
Server landing page: don't crash on bad layers
Browse files Browse the repository at this point in the history
  • Loading branch information
elpaso committed Oct 19, 2020
1 parent db1078a commit 2a67d49
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/server/services/landingpage/qgslandingpageutils.cpp
Expand Up @@ -583,7 +583,7 @@ json QgsLandingPageUtils::layerTree( const QgsProject &project, const QStringLis
if ( QgsLayerTree::isLayer( node ) )
{
const QgsLayerTreeLayer *l { static_cast<const QgsLayerTreeLayer *>( node ) };
if ( ( l->layer()->type() == QgsMapLayerType::VectorLayer || l->layer()->type() == QgsMapLayerType::RasterLayer )
if ( l->layer() && ( l->layer()->type() == QgsMapLayerType::VectorLayer || l->layer()->type() == QgsMapLayerType::RasterLayer )
&& ! wmsRestrictedLayers.contains( l->name() ) )
{
rec[ "id" ] = l->layerId().toStdString();
Expand Down

0 comments on commit 2a67d49

Please sign in to comment.