Skip to content

Commit

Permalink
Merge pull request #9730 from elpaso/fix-fake-group-3_6
Browse files Browse the repository at this point in the history
Fix crash when project has no groups and project OWS name equals to
  • Loading branch information
elpaso committed Apr 5, 2019
2 parents c77e393 + 2ecf0fe commit 0b0e95e
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions src/server/services/wms/qgswmsrenderer.cpp
Expand Up @@ -3497,9 +3497,19 @@ namespace QgsWms
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
Expand All @@ -3508,7 +3518,8 @@ namespace QgsWms
}
return _result;
};
for ( const auto &name : mWmsParameters.queryLayersNickname() )
const auto constNicks { mWmsParameters.queryLayersNickname() };
for ( const auto &name : constNicks )
{
result.append( findLeaves( name ) );
}
Expand Down

0 comments on commit 0b0e95e

Please sign in to comment.