Skip to content
Permalink
Browse files

Fix crash when project has no groups and project OWS name equals to

... first layer short name
  • Loading branch information
elpaso committed Apr 5, 2019
1 parent 8b508dd commit e6e6788b49d3bda4cf0fff7e13f830715bfec1f3
Showing with 14 additions and 3 deletions.
  1. +14 −3 src/server/services/wms/qgswmsrendercontext.cpp
@@ -167,9 +167,19 @@ QStringList QgsWmsRenderContext::flattenedQueryLayers() const
QStringList _result;
if ( mLayerGroups.contains( name ) )
{
for ( const auto &l : mLayerGroups[ name ] )
const auto &layers { mLayerGroups[ name ] };
for ( const auto &l : layers )
{
_result.append( findLeaves( l->shortName().isEmpty() ? l->name() : l->shortName() ) );
const auto nick { layerNickname( *l ) };
// This handles the case for root (fake) group
if ( mLayerGroups.contains( nick ) )
{
_result.append( name );
}
else
{
_result.append( findLeaves( nick ) );
}
}
}
else
@@ -178,7 +188,8 @@ QStringList QgsWmsRenderContext::flattenedQueryLayers() const
}
return _result;
};
for ( const auto &name : mParameters.queryLayersNickname() )
const auto constNicks { mParameters.queryLayersNickname() };
for ( const auto &name : constNicks )
{
result.append( findLeaves( name ) );
}

0 comments on commit e6e6788

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