units_dialog: move item erase from filter (#9839)

moved before `selected_index_` gets changed to -1 due to
`list_item_clicked()`
This commit is contained in:
Subhraman Sarkar 2025-02-04 16:34:51 +05:30
parent 0e2b92e210
commit e94f577d9a

View File

@ -276,6 +276,8 @@ void units_dialog::dismiss_unit(std::vector<unit_const_ptr>& unit_list, const te
// Remove the entry from the dialog list
list.remove_row(selected_index_);
// This line can change selected_index_, so the erasing needs to be done before it
list_item_clicked();
assert(filter_options_.size() == list.get_item_count());