From 23f58dfe8eb50c7c9231aa81c9a23a5259134cbf Mon Sep 17 00:00:00 2001 From: Neil Date: Sat, 13 Nov 2021 10:35:41 +1100 Subject: Bug [#2294] Fix assertion failure with autocompletion list when order is SC_ORDER_CUSTOM or SC_ORDER_PERFORMSORT and the list is empty. --- src/AutoComplete.cxx | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/AutoComplete.cxx b/src/AutoComplete.cxx index 47e942561..2bf88aa23 100644 --- a/src/AutoComplete.cxx +++ b/src/AutoComplete.cxx @@ -115,6 +115,11 @@ struct Sorter { Sorter(AutoComplete *ac_, const char *list_) : ac(ac_), list(list_) { int i = 0; + if (!list[i]) { + // Empty list has a single empty member + indices.push_back(i); // word start + indices.push_back(i); // word end + } while (list[i]) { indices.push_back(i); // word start while (list[i] != ac->GetTypesep() && list[i] != ac->GetSeparator() && list[i]) -- cgit v1.2.3