Bug report #6791
crash adding features to OGR layers if any attribute index is missing in the layer
Status: | Closed | ||
---|---|---|---|
Priority: | Normal | ||
Assignee: | Giuseppe Sucameli | ||
Category: | Data Provider | ||
Affected QGIS version: | master | Regression?: | No |
Operating System: | Easy fix?: | No | |
Pull Request or Patch supplied: | No | Resolution: | |
Crashes QGIS or corrupts data: | No | Copied to github as #: | 15939 |
Description
Here's the snippet to reproduce it.
feat = QgsFeature() feat.setAttributeMap( {"pk" : "1000000"} ) layer = self.iface.activeLayer() layer.startEditing() layer.addFeature( feat ) layer.commitChanges()
Ok, the crash depends on the wrong attribute map key which is a string instead of the integer index of the field, I know.
But this cause bindings convert the string to -1 which is passed as attribute index to the OGR library...
Associated revisions
fix crash adding features containing missing attributes (fix #6791)
History
#1 Updated by Giuseppe Sucameli almost 12 years ago
- Status changed from In Progress to Closed
Fixed in changeset 1a7ccd015d59b2316357af114464b01fea3bea9e.