summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcreator1creeper1 <creator1creeper1@airmail.cc>2022-01-07 14:55:58 +0100
committerAndreas Kling <kling@serenityos.org>2022-01-09 00:56:11 +0100
commitc1dc5ef9d7fe4a482a059aa1ffc96ddcffc3ac44 (patch)
tree029b1d90a4fe1cba35f15ed9c49954354d2e97b8
parent26eee2c02dcb2621f2756eaf3a5116aa5e06fefa (diff)
downloadserenity-c1dc5ef9d7fe4a482a059aa1ffc96ddcffc3ac44.zip
KeyboardMapper: Propagate errors using try_set_main_widget in main
-rw-r--r--Userland/Applications/KeyboardMapper/main.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/Userland/Applications/KeyboardMapper/main.cpp b/Userland/Applications/KeyboardMapper/main.cpp
index e210616456..1ebab62cad 100644
--- a/Userland/Applications/KeyboardMapper/main.cpp
+++ b/Userland/Applications/KeyboardMapper/main.cpp
@@ -34,11 +34,10 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
auto window = GUI::Window::construct();
window->set_title("Keyboard Mapper");
window->set_icon(app_icon.bitmap_for_size(16));
- window->set_main_widget<KeyboardMapperWidget>();
+ auto keyboard_mapper_widget = TRY(window->try_set_main_widget<KeyboardMapperWidget>());
window->resize(775, 315);
window->set_resizable(false);
- auto keyboard_mapper_widget = (KeyboardMapperWidget*)window->main_widget();
if (path.is_empty())
TRY(keyboard_mapper_widget->load_map_from_system());
else