Skip to content
Permalink
Browse files

Safety check for expression initialized

fixes #40762

(cherry picked from commit 6d28490)
  • Loading branch information
m-kuhn authored and nyalldawson committed Dec 28, 2020
1 parent a2e1a09 commit 3c7f85bbd1931cda182eaca84d09e5df31a9aa3d
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/core/symbology/qgsgraduatedsymbolrenderer.cpp
@@ -133,13 +133,13 @@ QVariant QgsGraduatedSymbolRenderer::valueForFeature( const QgsFeature &feature,
{
QgsAttributes attrs = feature.attributes();
QVariant value;
if ( mAttrNum < 0 || mAttrNum >= attrs.count() )
if ( mExpression )
{
value = mExpression->evaluate( &context.expressionContext() );
}
else
{
value = attrs.at( mAttrNum );
value = attrs.value( mAttrNum );
}

return value;

1 comment on commit 3c7f85b

@m-kuhn

This comment has been minimized.

Copy link
Member Author

@m-kuhn m-kuhn commented on 3c7f85b Dec 28, 2020

Thanks

Please sign in to comment.
You can’t perform that action at this time.