From 7ca57bc578277acb13f28e50c25ec3fab9c07fb8 Mon Sep 17 00:00:00 2001 From: frosch Date: Sat, 16 Aug 2014 21:13:58 +0000 Subject: (svn r26744) -Fix [FS6085-ish]: ScriptListSorterItemDescending::FindNext failed to detect the end. --- src/script/api/script_list.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/script') diff --git a/src/script/api/script_list.cpp b/src/script/api/script_list.cpp index 84f2b937c..a185e0d89 100644 --- 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; } -- cgit v1.2.3-54-g00ecf