Fix crash executeGeomOverlay called without context

Fix unreported crash.
This commit is contained in:
Alessandro Pasotti 2024-11-18 08:55:44 +01:00 committed by Nyall Dawson
parent 04446f9d56
commit 552b63a7e8

View File

@ -7746,6 +7746,12 @@ typedef bool ( QgsGeometry::*RelationFunction )( const QgsGeometry &geometry ) c
static QVariant executeGeomOverlay( const QVariantList &values, const QgsExpressionContext *context, QgsExpression *parent, const RelationFunction &relationFunction, bool invert = false, double bboxGrow = 0, bool isNearestFunc = false, bool isIntersectsFunc = false )
{
if ( ! context )
{
parent->setEvalErrorString( QObject::tr( "This function was called without an expression context." ) );
return QVariant();
}
const QVariant sourceLayerRef = context->variable( QStringLiteral( "layer" ) ); //used to detect if sourceLayer and targetLayer are the same
// TODO this function is NOT thread safe
Q_NOWARN_DEPRECATED_PUSH