Skip to content

Commit

Permalink
Return invalid variant instead of null variant when feature has no ge…
Browse files Browse the repository at this point in the history
…ometry

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 1b692d3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/expression/qgsexpressionfunction.cpp
Expand Up @@ -3172,7 +3172,7 @@ static QVariant fcnGeometry( const QVariantList &, const QgsExpressionContext *c
if ( !geom.isNull() )
return QVariant::fromValue( geom );
else
return QVariant( QVariant::UserType );
return QVariant();
}

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

0 comments on commit 1b692d3

Please sign in to comment.