Skip to content


Browse files Browse the repository at this point in the history
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.
  • Loading branch information
m-kuhn committed Dec 27, 2017
1 parent e552b9b commit aa3bfff
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/core/expression/qgsexpressionnode.cpp
Expand Up @@ -14,6 +14,7 @@

#include "qgsexpressionnode.h"
#include "qgsexpression.h"

QVariant QgsExpressionNode::eval( QgsExpression *parent, const QgsExpressionContext *context )
Expand All @@ -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;
mHasCachedValue = false;
return true;
Expand Down

0 comments on commit aa3bfff

Please sign in to comment.