Skip to content

Commit

Permalink
[BUGFIX][Server] Segfault when GetFeatureInfo on Raster layer to GML
Browse files Browse the repository at this point in the history
The PR #6279 has introduced some bug, like a segfault when a WMS GetFeatureInfo
is done on a Raster layer with output to GML.

This commit fixes it.
  • Loading branch information
rldhont committed Jun 1, 2018
1 parent 7160bac commit 21d15e7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/server/qgswmsserver.cpp
Expand Up @@ -3322,7 +3322,9 @@ QDomElement QgsWMSServer::createFeatureGML(
{
//qgs:%TYPENAME%
QDomElement typeNameElement = doc.createElement( "qgs:" + typeName /*qgs:%TYPENAME%*/ );
QString gmlId = featureGmlId( feat, layer->dataProvider()->pkAttributeIndexes() );
QString gmlId = QString::number( feat->id() );
if ( layer ) // For raster layer, layer is null
gmlId = featureGmlId( feat, layer->dataProvider()->pkAttributeIndexes() );
typeNameElement.setAttribute( "fid", typeName + "." + gmlId );

const QgsCoordinateTransform* transform = nullptr;
Expand Down

0 comments on commit 21d15e7

Please sign in to comment.