Skip to content
Permalink
Browse files

Fix single parameter version of represent_value

Fix #17407
  • Loading branch information
m-kuhn committed Nov 7, 2017
1 parent 07cef67 commit 5595f40fc6dc929250714e55d1e9ec5b58ad9918
Showing with 4 additions and 6 deletions.
  1. +4 −6 src/core/expression/qgsexpressionfunction.cpp
@@ -3435,15 +3435,13 @@ static QVariant fcnRepresentValue( const QVariantList &values, const QgsExpressi
{
QVariant result;
QString fieldName;
if ( values.size() == 1 )
if ( !values.isEmpty() )
{
QgsExpressionNodeColumnRef *col = dynamic_cast<QgsExpressionNodeColumnRef *>( node->args()->at( 0 ) );
if ( col )
if ( col && ( values.size() == 1 || !values.at( 1 ).isValid() ) )
fieldName = col->name();
}
else
{
fieldName = QgsExpressionUtils::getStringValue( values.at( 1 ), parent );
else if ( values.size() == 2 )
fieldName = QgsExpressionUtils::getStringValue( values.at( 1 ), parent );
}
QVariant value = values.at( 0 );

0 comments on commit 5595f40

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