mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 16:27:35 +00:00
WindowServer: Fix crash when hovering over title buttons
This fixes a crash where if you switched to a theme that has hover icons for title buttons, then back to a theme that does not. Then when you next hover over the title buttons the window server would crash. This was due to the hover_bitmap multi-scale bitmap pointer being non-null, but not containing any bitmaps, so hitting an assertion when painting.
This commit is contained in:
parent
74695ce76e
commit
857a767ab4
2 changed files with 2 additions and 1 deletions
|
@ -39,7 +39,7 @@ void Button::paint(Screen& screen, Gfx::Painter& painter)
|
|||
painter.blit(icon_location, bitmap, bitmap.rect());
|
||||
};
|
||||
|
||||
if (m_icon.hover_bitmap && m_hovered)
|
||||
if (m_hovered && m_icon.hover_bitmap && !m_icon.hover_bitmap->is_empty())
|
||||
paint_icon(m_icon.hover_bitmap);
|
||||
else if (m_icon.bitmap)
|
||||
paint_icon(m_icon.bitmap);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue