Skip to content
Permalink
Browse files
[server] Fixes segfault on wrong TypeName
Unreported - WFS-T

(cherry-picked from 8e781b4)

Funded by Boundless
  • Loading branch information
elpaso committed May 5, 2016
1 parent 32ea651 commit c68d7f9
Showing 1 changed file with 9 additions and 1 deletion.
@@ -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 c68d7f9

Please sign in to comment.