Bug report #1605
QgsGeometry().fromPolygon([[]]) crashes Qgis
| Status: | Closed | ||
|---|---|---|---|
| Priority: | Low | ||
| Assignee: | |||
| Category: | Vectors | ||
| Affected QGIS version: | Regression?: | No | |
| Operating System: | Linux | Easy fix?: | No |
| Pull Request or Patch supplied: | Resolution: | fixed | |
| Crashes QGIS or corrupts data: | Copied to github as #: | 11665 |
Description
I can make a geometry like this:
pol = [ QgsPoint(0,0),QgsPoint(0,1),QgsPoint(1,1)]
QgsGeometry.fromPolygon([pol])
<qgis.core.QgsGeometry object at 0x998aeac>
but if I do:
pol = []
QgsGeometry.fromPolygon([pol])
- crash:
Fatal: ASSERT failure in QVector<T>::operator[]: "index out of range", file /usr/include/qt4/QtCore/qvector.h, line 320
- this happened when a selection tool I wrote was trying to create a geometry from a list of coordinates that it hadn't filled yet. Carson Farmer had the same problem.
History
#1
Updated by Martin Dobias over 16 years ago
- Resolution set to fixed
- Status changed from Open to Closed
Fixed in (trunk) and (1.0)
Martin