Bug report #16637

Problem with empty values in getFeatures with OrderBy

Added by Marcos Medeiros almost 7 years ago. Updated over 6 years ago.

Affected QGIS version:2.16.1 Regression?:No
Operating System:Windows Easy fix?:No
Pull Request or Patch supplied:No Resolution:not reproducable
Crashes QGIS or corrupts data:No Copied to github as #:24537


I am trying to display features list on my own QAbstractTableModel.
By now it can sort columns just fine when all rows contains data. But whenever the column contains NULL/empty values the QgsVectorLayer::getFeatures method crash the application.

QgsFeatureRequest req;

req.addOrderBy(mLayer->attributeDisplayName(column), order == Qt::AscendingOrder);

QgsFeatureIterator it = mLayer->getFeatures(req);

QgsFeature feature;
long row = 0;
while (it.nextFeature(feature)) {
mRowToFeatureId[row++] = feature.id();


#1 Updated by Nyall Dawson almost 7 years ago

  • Status changed from Open to Feedback

2.16 is no longer supported. Is this reproducible in 2.18.9?

#2 Updated by Giovanni Manghi over 6 years ago

  • Resolution set to not reproducable
  • Status changed from Feedback to Closed

Closing for lack of feedback, please reopen if necessary.

Also available in: Atom PDF