Skip to content
Permalink
Browse files

[server] Fixes segfault on wrong TypeName

Unreported - WFS-T

Funded by Boundless
  • Loading branch information
elpaso committed May 5, 2016
1 parent d75eaff commit 8e781b4ec01b276e0c2be76db5742cf5227d6bd7
Showing with 9 additions and 1 deletion.
  1. +9 −1 src/server/qgswfsserver.cpp
@@ -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

0 comments on commit 8e781b4

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