Skip to content

Commit

Permalink
Avoid infinite sort loop when gathering feature lists for the value r…
Browse files Browse the repository at this point in the history
…elation editor widget
  • Loading branch information
nirvn authored and github-actions[bot] committed Dec 3, 2024
1 parent 52e2f84 commit c1b191a
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/core/featurelistmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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() )
{
Expand Down

0 comments on commit c1b191a

Please sign in to comment.