File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -4313,7 +4313,7 @@ bool QgsWithVariableExpressionFunction::isStatic( const QgsExpressionNodeFunctio
43134313 QgsExpressionContext *updatedContext = const_cast <QgsExpressionContext *>( context );
43144314 updatedContext->appendScope ( scope );
43154315
4316- if ( args->at ( 3 )->isStatic ( parent, updatedContext ) )
4316+ if ( args->at ( 2 )->isStatic ( parent, updatedContext ) )
43174317 isStatic = true ;
43184318 updatedContext->popScope ();
43194319 }
@@ -4336,9 +4336,13 @@ QVariant QgsWithVariableExpressionFunction::run( QgsExpressionNode::NodeList *ar
43364336 scope->setVariable ( name.toString (), value );
43374337
43384338 QgsExpressionContext *updatedContext = const_cast <QgsExpressionContext *>( context );
4339+ if ( !context )
4340+ updatedContext = new QgsExpressionContext ();
43394341 updatedContext->appendScope ( scope );
43404342 result = args->at ( 2 )->eval ( parent, updatedContext );
43414343 delete updatedContext->popScope ();
4344+ if ( !context )
4345+ delete updatedContext;
43424346
43434347 return result;
43444348}
You can’t perform that action at this time.
0 commit comments