Skip to content

Commit

Permalink
[BUGFIX][Server] WFS GetFeature GML: segfault with geometry null
Browse files Browse the repository at this point in the history
  • Loading branch information
rldhont committed Feb 20, 2018
1 parent b719441 commit 1582073
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/server/services/wfs/qgswfsgetfeature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1245,11 +1245,10 @@ namespace QgsWfs
typeNameElement.setAttribute( QStringLiteral( "fid" ), params.typeName + "." + QString::number( feat->id() ) );
featureElement.appendChild( typeNameElement );

if ( params.withGeom && params.geometryName != QLatin1String( "NONE" ) )
//add geometry column (as gml)
QgsGeometry geom = feat->geometry();
if ( geom && params.withGeom && params.geometryName != QLatin1String( "NONE" ) )
{
//add geometry column (as gml)
QgsGeometry geom = feat->geometry();

int prec = params.precision;
QgsCoordinateReferenceSystem crs = params.crs;
Q_NOWARN_DEPRECATED_PUSH
Expand Down Expand Up @@ -1348,11 +1347,10 @@ namespace QgsWfs
typeNameElement.setAttribute( QStringLiteral( "gml:id" ), params.typeName + "." + QString::number( feat->id() ) );
featureElement.appendChild( typeNameElement );

if ( params.withGeom && params.geometryName != QLatin1String( "NONE" ) )
//add geometry column (as gml)
QgsGeometry geom = feat->geometry();
if ( geom && params.withGeom && params.geometryName != QLatin1String( "NONE" ) )
{
//add geometry column (as gml)
QgsGeometry geom = feat->geometry();

int prec = params.precision;
QgsCoordinateReferenceSystem crs = params.crs;
Q_NOWARN_DEPRECATED_PUSH
Expand Down

0 comments on commit 1582073

Please sign in to comment.