This commit is contained in:
Alex 2020-11-14 10:53:51 -05:00 committed by GitHub
parent 2688389332
commit a36de0942b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5324,7 +5324,7 @@ static QVariant fcnArrayGet( const QVariantList &values, const QgsExpressionCont
{ {
const QVariantList list = QgsExpressionUtils::getListValue( values.at( 0 ), parent ); const QVariantList list = QgsExpressionUtils::getListValue( values.at( 0 ), parent );
const int pos = QgsExpressionUtils::getNativeIntValue( values.at( 1 ), parent ); const int pos = QgsExpressionUtils::getNativeIntValue( values.at( 1 ), parent );
if ( pos < list.length() && pos >=0 ) return list.at( pos ); if ( pos < list.length() && pos >= 0 ) return list.at( pos );
else if ( pos < 0 && ( list.length() + pos ) >= 0 ) else if ( pos < 0 && ( list.length() + pos ) >= 0 )
return list.at( list.length() + pos ); return list.at( list.length() + pos );
return QVariant(); return QVariant();