1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 12:38:12 +00:00

WindowServer: Don't crash when encountering unsorted menu applets

Fixes #1862.
This commit is contained in:
Andreas Kling 2020-04-19 19:37:23 +02:00
parent 98b990f20b
commit 3b434068eb

View file

@ -79,9 +79,7 @@ void AppletManager::add_applet(Window& applet)
quick_sort(m_applets, [](auto& a, auto& b) {
auto index_a = order_vector.find_first_index(a->title());
auto index_b = order_vector.find_first_index(b->title());
ASSERT(index_a.has_value());
ASSERT(index_b.has_value());
return index_a.value() > index_b.value();
return index_a.value_or("") > index_b.value_or("");
});
calculate_applet_rects(MenuManager::the().window());