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

WindowServer: Check that a menu is not null

If an application menu is null, WindowServer crashes
This commit is contained in:
Lorenzo Concas 2022-05-06 16:42:35 +02:00 committed by Linus Groh
parent 5aad6a4378
commit a67a7229f8

View file

@ -178,7 +178,11 @@ void Menu::draw()
m_theme_index_at_last_paint = MenuManager::the().theme_index();
VERIFY(menu_window());
VERIFY(menu_window()->backing_store());
// When an application has an empty menu, we don't want to draw it
if (menu_window()->backing_store() == nullptr)
return;
Gfx::Painter painter(*menu_window()->backing_store());
Gfx::IntRect rect { {}, menu_window()->size() };