# HG changeset patch # User frosch # Date 2014-08-16 21:13:58 # Node ID 0b64a185f3a144991be153b5030b6c067a090608 # Parent 0289944dc38c8828340cd8e70f8ee1cffe54e12b (svn r26744) -Fix [FS6085-ish]: ScriptListSorterItemDescending::FindNext failed to detect the end. diff --git a/src/script/api/script_list.cpp b/src/script/api/script_list.cpp --- a/src/script/api/script_list.cpp +++ b/src/script/api/script_list.cpp @@ -362,7 +362,12 @@ public: this->has_no_more_items = true; return; } - this->item_iter--; + if (this->item_iter == this->list->items.begin()) { + /* Use 'end' as marker for 'beyond begin' */ + this->item_iter = this->list->items.end(); + } else { + this->item_iter--; + } if (this->item_iter != this->list->items.end()) item_next = (*this->item_iter).first; }