Skip to content

Commit

Permalink
[server] Fixes segfault on wrong TypeName
Browse files Browse the repository at this point in the history
Unreported - WFS-T

Funded by Boundless
  • Loading branch information
elpaso committed May 5, 2016
1 parent d75eaff commit 8e781b4
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/server/qgswfsserver.cpp
Expand Up @@ -1474,7 +1474,15 @@ QDomDocument QgsWFSServer::transaction( const QString& requestBody )
mTypeName = typeNameElem.tagName();

layerList = mConfigParser->mapLayerFromTypeName( mTypeName );
currentLayer = layerList.at( 0 );
// Could be empty!
if ( layerList.count() > 0 )
{
currentLayer = layerList.at( 0 );
}
else
{
throw QgsMapServiceException( "RequestNotWellFormed", QString( "Wrong TypeName: %1" ).arg( mTypeName ) );
}

QgsVectorLayer* layer = qobject_cast<QgsVectorLayer*>( currentLayer );
// it's a vectorlayer and defined by the administrator as a WFS layer
Expand Down

0 comments on commit 8e781b4

Please sign in to comment.