Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Remove layer nullptr redundant check
  • Loading branch information
elpaso committed Dec 15, 2021
1 parent 6431f5c commit 3939840
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/expression/qgsexpressionfunction.cpp
Expand Up @@ -1775,7 +1775,7 @@ static QVariant fcnRepresentAttributes( const QVariantList &values, const QgsExp
{
const QString fieldName { fields.at( fieldIndex ).name() };
QVariant attributeVal { feature.attribute( fieldIndex ) };
const QString cacheValueKey = QStringLiteral( "repvalfcnval:%1:%2:%3" ).arg( layer ? layer->id() : QStringLiteral( "[None]" ), fieldName, attributeVal.toString() );
const QString cacheValueKey = QStringLiteral( "repvalfcnval:%1:%2:%3" ).arg( layer->id(), fieldName, attributeVal.toString() );
if ( context && context->hasCachedValue( cacheValueKey ) )
{
result.insert( fieldName, context->cachedValue( cacheValueKey ) );
Expand All @@ -1787,7 +1787,7 @@ static QVariant fcnRepresentAttributes( const QVariantList &values, const QgsExp
QVariant cache;
if ( context )
{
const QString cacheKey = QStringLiteral( "repvalfcn:%1:%2" ).arg( layer ? layer->id() : QStringLiteral( "[None]" ), fieldName );
const QString cacheKey = QStringLiteral( "repvalfcn:%1:%2" ).arg( layer->id() , fieldName );

if ( !context->hasCachedValue( cacheKey ) )
{
Expand Down

0 comments on commit 3939840

Please sign in to comment.