Skip to content
Browse files

Return invalid variant instead of null variant when feature has no ge…


Otherwise the sip wrapper around the returned variant does NOT
return true to QVariant::isNull() when run from outside QgsApplication.

Anyway, it's more sane and brings this function into line with
the other expression functions which return QVariants() instead
of usertype null QVariants
  • Loading branch information
nyalldawson committed Feb 8, 2021
1 parent 7bc0f19 commit 1b692d3cae85a8701f5eb2704ed6eae471b1c140
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/core/expression/qgsexpressionfunction.cpp
@@ -3172,7 +3172,7 @@ static QVariant fcnGeometry( const QVariantList &, const QgsExpressionContext *c
if ( !geom.isNull() )
return QVariant::fromValue( geom );
return QVariant( QVariant::UserType );
return QVariant();

static QVariant fcnGeomFromWKT( const QVariantList &values, const QgsExpressionContext *, QgsExpression *parent, const QgsExpressionNodeFunction * )

0 comments on commit 1b692d3

Please sign in to comment.