mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 07:30:19 +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:
parent
3b2120e7b6
commit
e64f43c3a7
Notes:
sideshowbarker
2024-07-19 02:05:12 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/e64f43c3a75
1 changed files with 4 additions and 2 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue