Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Safety check for expression initialized
- Loading branch information
Showing
with
2 additions
and
2 deletions.
-
+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; |
|
|