Skip to content
Permalink
Browse files

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

…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 5, 2021
1 parent b436153 commit 085e871d15d3944388186c3bfdc86ca579e0156c
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 );
else
return QVariant( QVariant::UserType );
return QVariant();
}

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

0 comments on commit 085e871

Please sign in to comment.