Skip to content
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

[wms] Do not pass null QStrings to QgsWmsProvider::setQueryItem #8388

Merged
merged 2 commits into from
Oct 31, 2018

Conversation

elpaso
Copy link
Contributor

@elpaso elpaso commented Oct 31, 2018

Fix #20271 - WMS is not displayed in QGIS 3.4.0

With test

Fix qgis#20271 - WMS is not displayed in QGIS 3.4.0

With test
Copy link
Collaborator

@nyalldawson nyalldawson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a qt 5.11 related change? What's introduced this? (I think I've seen it elsewhere too recently)

@@ -482,7 +482,10 @@ bool QgsWmsProvider::setImageCrs( QString const &crs )
void QgsWmsProvider::setQueryItem( QUrl &url, const QString &item, const QString &value )
{
url.removeQueryItem( item );
url.addQueryItem( item, value );
if ( value.isNull() )
url.addQueryItem( item, QStringLiteral( "" ) );
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

QString()

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No: that is exactly the source of the problem: a null string will trigger the error.

Copy link
Contributor Author

@elpaso elpaso Oct 31, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know exactly when the problem appeared, the fact is that QString().isNull() == true and that's exactly the source of the issue.

@elpaso elpaso merged commit 467fae8 into qgis:master Oct 31, 2018
@elpaso elpaso deleted the bugfix-20271-wms-null-styles branch October 31, 2018 12:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants