From 7f93da4af3ae991845ed7c2ff7c2ddb242a7a298 Mon Sep 17 00:00:00 2001 From: Mathieu Pellerin Date: Tue, 3 Dec 2024 08:09:19 +0700 Subject: [PATCH] Avoid infinite sort loop when gathering feature lists for the value relation editor widget --- src/core/featurelistmodel.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/core/featurelistmodel.cpp b/src/core/featurelistmodel.cpp index 29d659701a..b58632b091 100644 --- a/src/core/featurelistmodel.cpp +++ b/src/core/featurelistmodel.cpp @@ -398,16 +398,14 @@ void FeatureListModel::processFeatureList() if ( mOrderByValue || !mGroupField.isEmpty() || !mSearchTerm.isEmpty() ) { std::sort( entries.begin(), entries.end(), [=]( const Entry &entry1, const Entry &entry2 ) { - if ( entry1.key.isNull() ) + if ( entry1.key.isNull() && !entry2.key.isNull() ) return true; - if ( entry2.key.isNull() ) + if ( !entry1.key.isNull() && entry2.key.isNull() ) return false; if ( !mGroupField.isEmpty() && entry1.group != entry2.group ) - { return entry1.group < entry2.group; - } if ( !mSearchTerm.isEmpty() ) {