From 575b6740816c49c8fbbfd8f63bd5bed0a0fdbb0c Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Tue, 12 May 2020 14:06:25 +0200 Subject: [PATCH] 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! :^) --- Libraries/LibGUI/Widget.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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(*event.child())) + if (window() && event.child() && Core::is(*event.child())) window()->did_remove_widget({}, Core::to(*event.child())); update(); }