Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[Server] WMS GetMap throw exception is layer nickname is not available
  • Loading branch information
rldhont committed Jun 5, 2017
1 parent fc63cbe commit 569cee1
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/server/services/wms/qgswmsrenderer.cpp
Expand Up @@ -2989,6 +2989,11 @@ namespace QgsWms
mNicknameLayers[lname]->setCustomProperty( "readSLD", true );
layers.append( mNicknameLayers[lname] );
}
else
{
throw QgsBadRequestException( QStringLiteral( "LayerNotDefined" ),
QStringLiteral( "Layer \"%1\" does not exist" ).arg( lname ) );
}
}
}
}
Expand All @@ -3005,7 +3010,7 @@ namespace QgsWms
{
QString nickname = param.mNickname;
QString style = param.mStyle;
if ( mNicknameLayers.contains( nickname ) )
if ( mNicknameLayers.contains( nickname ) && !mRestrictedLayers.contains( nickname ) )
{
if ( !style.isEmpty() )
{
Expand All @@ -3018,6 +3023,11 @@ namespace QgsWms

layers.append( mNicknameLayers[nickname] );
}
else
{
throw QgsBadRequestException( QStringLiteral( "LayerNotDefined" ),
QStringLiteral( "Layer \"%1\" does not exist" ).arg( nickname ) );
}
}

return layers;
Expand Down

0 comments on commit 569cee1

Please sign in to comment.