Showing with 4 additions and 1 deletion.
  1. +4 −1 src/core/qgsexpression.cpp
5 changes: 4 additions & 1 deletion src/core/qgsexpression.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2243,7 +2243,10 @@ QVariant QgsExpression::NodeColumnRef::eval( QgsExpression* /*parent*/, QgsFeatu
{
if ( f )
{
return f->attribute( mIndex );
if ( mIndex >= 0 )
return f->attribute( mIndex );
else
return f->attribute( mName );
}
return QVariant( "[" + mName + "]" );
}
Expand Down