diff options
author | creator1creeper1 <creator1creeper1@airmail.cc> | 2022-01-07 14:55:58 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-01-09 00:56:11 +0100 |
commit | c1dc5ef9d7fe4a482a059aa1ffc96ddcffc3ac44 (patch) | |
tree | 029b1d90a4fe1cba35f15ed9c49954354d2e97b8 | |
parent | 26eee2c02dcb2621f2756eaf3a5116aa5e06fefa (diff) | |
download | serenity-c1dc5ef9d7fe4a482a059aa1ffc96ddcffc3ac44.zip |
KeyboardMapper: Propagate errors using try_set_main_widget in main
-rw-r--r-- | Userland/Applications/KeyboardMapper/main.cpp | 3 |
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 |