mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-05-26 21:18:44 +00:00
LibGUI: Fix null pointer dereference in enter/leave event handling
If an enter/leave event is delivered to a widget after it is removed from a window, we can't just assume a window is gonna be there. Fixes #3669.
This commit is contained in:
@@ -342,14 +342,16 @@ void Widget::handle_mousedoubleclick_event(MouseEvent& event)
|
||||
|
||||
void Widget::handle_enter_event(Core::Event& event)
|
||||
{
|
||||
window()->update_cursor({});
|
||||
if (auto* window = this->window())
|
||||
window->update_cursor({});
|
||||
show_tooltip();
|
||||
enter_event(event);
|
||||
}
|
||||
|
||||
void Widget::handle_leave_event(Core::Event& event)
|
||||
{
|
||||
window()->update_cursor({});
|
||||
if (auto* window = this->window())
|
||||
window->update_cursor({});
|
||||
Application::the()->hide_tooltip();
|
||||
leave_event(event);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user