Bug report #9166

invalid field name in expressions make QGIS crash in debug mode

Added by Denis Rouzaud almost 6 years ago. Updated almost 6 years ago.

Status:Closed
Priority:Normal
Assignee:-
Category:Vectors
Affected QGIS version:2.0.1 Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:17798

Description

If you have invalid field names in the expression of a label in a layer, QGIS will crash at start.
The crash occurs in the method prepareJoins and it occurs only in Debug (not in Release).

Associated revisions

Revision f428c869
Added by Matthias Kuhn almost 6 years ago

Safety check when joining before accessing fields
Fix #9166

History

#1 Updated by Jürgen Fischer almost 6 years ago

  • Priority changed from Severe/Regression to Normal

Not reproducable here. Tried joining a shape with a csv and renamed the csv field on windows 64bit. no crash.

#2 Updated by Jürgen Fischer almost 6 years ago

  • Status changed from Open to Feedback

#3 Updated by Matthias Kuhn almost 6 years ago

  • Status changed from Feedback to Closed

#4 Updated by Matthias Kuhn almost 6 years ago

I wonder if we should change all the QgsFields methods from [] to .value() which does check if the index exists at the cost of a probably neglectable overhead.

Also available in: Atom PDF