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

[bugfix] Crash when exporting (invalid) legend to qlr #7195

Merged
merged 5 commits into from
Jun 7, 2018

Conversation

elpaso
Copy link
Contributor

@elpaso elpaso commented Jun 6, 2018

Fixes #18981 Save QLR crashes QGIS 3

This patch definitely prevents the crash but I'm not sure if
we should also introduce the same check in QgsLayerTree::isLayer
or even in QgsLayerTreeGroup::findLayers() or also when importing
a qlr that might lead to invalid layer (like in this
bug report).

Fixes qgis#18981 Save QLR crashes QGIS 3

This patch definitely prevents the crash but I'm not sure if
we should also introduce the same check in QgsLayerTree::isLayer
or even in QgsLayerTreeGroup::findLayers() or also when importing
a qlr that might lead to invalid layer (like in this
bug report).
@nyalldawson
Copy link
Collaborator

I think this fix is good, but I'd also like to see the check be done in QgsLayerTreeGroup::findLayers() in case this bug may be present elsewhere.

@elpaso elpaso merged commit 51ae8e9 into qgis:master Jun 7, 2018
@elpaso elpaso deleted the bugfix-18981-export-qlr-crash-2 branch June 7, 2018 07:55
@nirvn
Copy link
Contributor

nirvn commented Jun 17, 2018

@elpaso , commit 2f2221a led to this regression: https://issues.qgis.org/issues/19199

@elpaso
Copy link
Contributor Author

elpaso commented Jun 17, 2018

Thanks. I'll have a look ASAP

@nirvn
Copy link
Contributor

nirvn commented Jun 17, 2018

@elpaso , should we revert for now (to avoid shipping 3.2 with this regression), or will you be able to address this prior to June 22? :)

@elpaso
Copy link
Contributor Author

elpaso commented Jun 17, 2018

I should make it in time. BTW my commit fixed a crash and this is not.

@elpaso
Copy link
Contributor Author

elpaso commented Jun 17, 2018

@nirvn Is should be fixed in current master.

@nirvn
Copy link
Contributor

nirvn commented Jun 17, 2018

@elpaso , that was fast :) cheers.

Is there a way to add a test to safeguard the code from this specific regression?

@elpaso
Copy link
Contributor Author

elpaso commented Jun 17, 2018

The regression was caused by the commit that you bisected.

For now I just reverted the offending commit and the regression is gone, the original bug targeted by this PR was indeed already fixed by my first commit: ec909b0

@qgib qgib mentioned this pull request May 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants