Skip to content

Commit 18fd401

Browse files
committed
Fix #9501 (expression crash when $geometry is used without a feature)
1 parent a0fc024 commit 18fd401

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/core/qgsexpression.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -976,7 +976,7 @@ static QVariant fcnYat( const QVariantList& values, const QgsFeature* f, QgsExpr
976976
}
977977
static QVariant fcnGeometry( const QVariantList& , const QgsFeature* f, QgsExpression* )
978978
{
979-
QgsGeometry* geom = f->geometry();
979+
QgsGeometry* geom = f ? f->geometry() : 0;
980980
if ( geom )
981981
return QVariant::fromValue( *geom );
982982
else

0 commit comments

Comments
 (0)