diff options
author | Andreas Kling <kling@serenityos.org> | 2020-05-12 14:06:25 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-05-12 14:06:25 +0200 |
commit | 575b6740816c49c8fbbfd8f63bd5bed0a0fdbb0c (patch) | |
tree | 0418c0c4a0d6ad336615ab3bc2b9781bb60d2dd2 /Libraries/LibGUI/Widget.cpp | |
parent | 9d6c85e6a60bc0ca65a79d30e166ba8482af88aa (diff) | |
download | serenity-575b6740816c49c8fbbfd8f63bd5bed0a0fdbb0c.zip |
LibGUI: Add missing window() null check when widget's child is removed
Before notifying our window that a child was removed, we should first
check that we actually have a window! :^)
Diffstat (limited to 'Libraries/LibGUI/Widget.cpp')
-rw-r--r-- | Libraries/LibGUI/Widget.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Libraries/LibGUI/Widget.cpp b/Libraries/LibGUI/Widget.cpp index 67be0bfd0a..666ca70ed4 100644 --- a/Libraries/LibGUI/Widget.cpp +++ b/Libraries/LibGUI/Widget.cpp @@ -123,7 +123,7 @@ void Widget::child_event(Core::ChildEvent& event) else invalidate_layout(); } - if (event.child() && Core::is<Widget>(*event.child())) + if (window() && event.child() && Core::is<Widget>(*event.child())) window()->did_remove_widget({}, Core::to<Widget>(*event.child())); update(); } |