1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 03:17:35 +00:00

Run: Fix bug where it would crash because uninitialized main widget

The set_main_widget<T>() function only calls the construct and not
`try_create()` that the GMLCompiler generates so all calls to
`find_descendant_of_type_named()` would result in null
pointers that would resolve in a crash.
This commit is contained in:
Bastiaan van der Plaat 2024-01-30 21:54:20 +01:00 committed by Andreas Kling
parent 747fd86f26
commit 582bf1eaf3
3 changed files with 12 additions and 3 deletions

View file

@ -13,6 +13,8 @@
#include <LibGUI/ItemListModel.h>
#include <LibGUI/Window.h>
namespace Run {
class RunWindow final : public GUI::Window {
C_OBJECT(RunWindow)
public:
@ -40,3 +42,5 @@ private:
RefPtr<GUI::Button> m_browse_button;
RefPtr<GUI::ComboBox> m_path_combo_box;
};
}