Bug report #11703
Add Invalid Layer to QgsLayerTreeGroup crashes QGIS 2.6
Status: | Closed | ||
---|---|---|---|
Priority: | Normal | ||
Assignee: | Martin Dobias | ||
Category: | - | ||
Affected QGIS version: | 2.6.0 | Regression?: | No |
Operating System: | Easy fix?: | No | |
Pull Request or Patch supplied: | No | Resolution: | |
Crashes QGIS or corrupts data: | No | Copied to github as #: | 19945 |
Description
Hi, I know that this isn't the expected scenario. But if we feed QgsLayerTreeGroup with invalid layer, e.g just give it None, it will crash QGIS.
Simple script that can be run in QGIS Python Console :
a = QgsLayerTreeGroup() a.addLayer(None)
I think throwing Exception is better than not handling it at all
Associated revisions
History
#1 Updated by Tim Sutton about 10 years ago
- Assignee changed from Tim Sutton to Martin Dobias
#2 Updated by Martin Dobias almost 10 years ago
- Status changed from Open to Closed
Fixed in changeset f28a6d1d7d426286f67b94b094a6653aec69f0a3.