mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-18 00:03:05 -04:00
Do not cache expression nodes with eval errors
When there is an evaluation error in an expression, there is no need to cache results. With the previous approach, sometimes eval errors were not reported because the error was set to false (Null), evaluation triggered again but it didn't report any more eval errors because it was relying on cached values.
This commit is contained in:
parent
e552b9b2de
commit
aa3bfff7a8
@ -14,6 +14,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
#include "qgsexpressionnode.h"
|
||||
#include "qgsexpression.h"
|
||||
|
||||
|
||||
QVariant QgsExpressionNode::eval( QgsExpression *parent, const QgsExpressionContext *context )
|
||||
@ -34,7 +35,10 @@ bool QgsExpressionNode::prepare( QgsExpression *parent, const QgsExpressionConte
|
||||
if ( isStatic( parent, context ) )
|
||||
{
|
||||
mCachedStaticValue = evalNode( parent, context );
|
||||
mHasCachedValue = true;
|
||||
if ( !parent->hasEvalError() )
|
||||
mHasCachedValue = true;
|
||||
else
|
||||
mHasCachedValue = false;
|
||||
return true;
|
||||
}
|
||||
else
|
||||
|
Loading…
x
Reference in New Issue
Block a user