-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(regexp_replace): handle null value #59186
Conversation
🪟 Windows buildsDownload Windows builds of this PR for testing. 🪟 Windows Qt6 buildsDownload Windows Qt6 builds of this PR for testing. |
@@ -1609,13 +1609,20 @@ static QVariant fcnRegexpReplace( const QVariantList &values, const QgsExpressio | |||
QString str = QgsExpressionUtils::getStringValue( values.at( 0 ), parent ); | |||
QString regexp = QgsExpressionUtils::getStringValue( values.at( 1 ), parent ); | |||
QString after = QgsExpressionUtils::getStringValue( values.at( 2 ), parent ); | |||
bool isValid_after{ values.at( 2 ).isValid() }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bool isValid_after{ values.at( 2 ).isValid() }; | |
bool isValid_after{ values.at( 2 ).isValid() && !values.at( 2 ).isNull() }; |
Not sure of myself here. But I'm also wondering if just the isNull() condition wouldn't be enough ?
In your test, if you replace QVariant with QVariant( QMetaType::String ) for instance, it would be valid and null, and so your fix wouldn't work, no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should always use QgsVariantUtils::isNull for these checks.
The QGIS project highly values your contribution and would love to see this work merged! Unfortunately this PR has not had any activity in the last 14 days and is being automatically marked as "stale". If you think this pull request should be merged, please check
|
While we hate to see this happen, this PR has been automatically closed because it has not had any activity in the last 21 days. If this pull request should be reconsidered, please follow the guidelines in the previous comment and reopen this pull request. Or, if you have any further questions, just ask! We love to help, and if there's anything the QGIS project can do to help push this PR forward please let us know how we can assist. |
Description
Resurrect Fix for #44274