summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-04-19 19:37:23 +0200
committerAndreas Kling <kling@serenityos.org>2020-04-19 19:40:04 +0200
commit3b434068eb31db19e6c3c672eb59a33343fcffa2 (patch)
tree1b24c66c10bd0b2c205012087ac480ccb6d3b39c
parent98b990f20b9d7aa7943442c3b436a6e27b7c3e53 (diff)
downloadserenity-3b434068eb31db19e6c3c672eb59a33343fcffa2.zip
WindowServer: Don't crash when encountering unsorted menu applets
Fixes #1862.
-rw-r--r--Servers/WindowServer/AppletManager.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/Servers/WindowServer/AppletManager.cpp b/Servers/WindowServer/AppletManager.cpp
index 16cdf4c9da..e07fd46220 100644
--- a/Servers/WindowServer/AppletManager.cpp
+++ b/Servers/WindowServer/AppletManager.cpp
@@ -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());