Skip to content

Commit

Permalink
check returned QDomElement and return if empty
Browse files Browse the repository at this point in the history
  • Loading branch information
signedav authored and nyalldawson committed Jul 20, 2022
1 parent 555f9e8 commit 8041b6e
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/core/qgsogcutils.cpp
Expand Up @@ -2350,6 +2350,11 @@ QDomElement QgsOgcUtilsExprToFilter::expressionFunctionToOgcFilter( const QgsExp
const QgsGeometry geom = QgsGeometry::fromWkt( wkt );
otherGeomElem = QgsOgcUtils::geometryToGML( geom, mDoc, mGMLVersion, mSrsName, mInvertAxisOrientation,
QStringLiteral( "qgis_id_geom_%1" ).arg( mGeomId ) );
if ( otherGeomElem.isNull() )
{
mErrorMessage = QObject::tr( "geom_from_wkt: unable to genererate GML from wkt geometry" );
return QDomElement();
}
mGeomId ++;
}
else if ( otherFnDef->name() == QLatin1String( "geom_from_gml" ) )
Expand Down Expand Up @@ -2377,6 +2382,11 @@ QDomElement QgsOgcUtilsExprToFilter::expressionFunctionToOgcFilter( const QgsExp
QgsGeometry geom = otherNode->cachedStaticValue().value<QgsGeometry>();
otherGeomElem = QgsOgcUtils::geometryToGML( geom, mDoc, mGMLVersion, mSrsName, mInvertAxisOrientation,
QStringLiteral( "qgis_id_geom_%1" ).arg( mGeomId ) );
if ( otherGeomElem.isNull() )
{
mErrorMessage = QObject::tr( "geom from static value: unable to genererate GML from static variable" );
return QDomElement();
}
mGeomId ++;
}
else
Expand Down

0 comments on commit 8041b6e

Please sign in to comment.