Skip to content

Commit

Permalink
Don't wrongly return the expression of another field
Browse files Browse the repository at this point in the history
Fix #46231
  • Loading branch information
domi4484 committed Nov 29, 2021
1 parent eb871be commit e1cfb4e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/core/vector/qgsvectorlayer.cpp
Expand Up @@ -3914,6 +3914,9 @@ void QgsVectorLayer::removeExpressionField( int index )

QString QgsVectorLayer::expressionField( int index ) const
{
if ( mFields.fieldOrigin( index ) != QgsFields::OriginExpression )
return QString();

int oi = mFields.fieldOriginIndex( index );
if ( oi < 0 || oi >= mExpressionFieldBuffer->expressions().size() )
return QString();
Expand Down

0 comments on commit e1cfb4e

Please sign in to comment.