summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Groh <mail@linusgroh.de>2020-12-18 13:47:04 +0000
committerAndreas Kling <kling@serenityos.org>2020-12-18 19:20:15 +0100
commitfe88f46bc9f95091e5fc28268deacf781392faa4 (patch)
treea0340a5445c8c42c226d9650aa94b783fc6c26dc
parent573d5b7ff2698811c1a69d4502a84842c8346607 (diff)
downloadserenity-fe88f46bc9f95091e5fc28268deacf781392faa4.zip
LibGUI: Don't assume main widget exists in Window::handle_resize_event()
Just like the other event handler functions, handle_resize_event() shouldn't assume that the window has a main widget (which is being resized in this case). Fixes #4450.
-rw-r--r--Libraries/LibGUI/Window.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/Libraries/LibGUI/Window.cpp b/Libraries/LibGUI/Window.cpp
index 7389b1d350..450e0b4e82 100644
--- a/Libraries/LibGUI/Window.cpp
+++ b/Libraries/LibGUI/Window.cpp
@@ -377,7 +377,8 @@ void Window::handle_resize_event(ResizeEvent& event)
m_pending_paint_event_rects.append({ {}, new_size });
}
m_rect_when_windowless = { {}, new_size };
- m_main_widget->set_relative_rect({ {}, new_size });
+ if (m_main_widget)
+ m_main_widget->set_relative_rect({ {}, new_size });
}
void Window::handle_input_entered_or_left_event(Core::Event& event)