Skip to content

Commit

Permalink
change if conditon
Browse files Browse the repository at this point in the history
Because the function always gets 3 values...
  • Loading branch information
roya0045 committed Dec 8, 2021
1 parent c88f601 commit 8352736
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/core/expression/qgsexpressionfunction.cpp
Expand Up @@ -5477,7 +5477,7 @@ static QVariant fcnGetFeature( const QVariantList &values, const QgsExpressionCo
}
QgsFeatureRequest req;
QString cacheValueKey;
if ( values.size() == 2 && values.at( 1 ).type() == QVariant::Map )
if ( values.at( 1 ).type() == QVariant::Map )
{
QVariantMap attributeMap = QgsExpressionUtils::getMapValue( values.at( 1 ), parent );

Expand Down
4 changes: 2 additions & 2 deletions tests/src/core/testqgsexpression.cpp
Expand Up @@ -2248,8 +2248,8 @@ class TestQgsExpression: public QObject
QTest::newRow( "get_feature_by_id" ) << "get_feature_by_id('test', 1)" << true << 1;

// multi-param
QTest::newRow( "get_feature multi1" ) << "get_feature('test',map('col1',11,'col2','test2'))" << true << 2;
QTest::newRow( "get_feature multi2" ) << "get_feature('test',map('col1',3,'col2','test3'))" << true << 3;
QTest::newRow( "get_feature multi1" ) << "get_feature('test',map('col1','11','col2','test2'))" << true << 2;
QTest::newRow( "get_feature multi2" ) << "get_feature('test',map('col1','3','col2','test3'))" << true << 3;

// multi-param no match
QTest::newRow( "get_feature no match-multi1" ) << "get_feature('test',map('col1','col2'),'no match!')" << false << -1;
Expand Down

0 comments on commit 8352736

Please sign in to comment.