Skip to content
Permalink
Browse files

[Server] WMS GetMap throw exception is layer nickname is not available

  • Loading branch information
rldhont committed Jun 5, 2017
1 parent fc63cbe commit 569cee190130c59c477a7f553a2fd5add6827e8d
Showing with 11 additions and 1 deletion.
  1. +11 −1 src/server/services/wms/qgswmsrenderer.cpp
@@ -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 ) );
}
}
}
}
@@ -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() )
{
@@ -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;

0 comments on commit 569cee1

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