Applets/Network: Propagate errors with try_set_main_widget
Use try_set_main_widget instead of set_main_widget.
This commit is contained in:
parent
43ecf1d429
commit
f125d52622
Notes:
sideshowbarker
2024-07-17 21:45:11 +09:00
Author: https://github.com/creator1creeper1 Commit: https://github.com/SerenityOS/serenity/commit/f125d526221 Pull-request: https://github.com/SerenityOS/serenity/pull/11419
1 changed files with 2 additions and 2 deletions
|
@ -183,8 +183,8 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
window->set_window_type(GUI::WindowType::Applet);
|
||||
window->set_has_alpha_channel(true);
|
||||
window->resize(16, 16);
|
||||
auto& icon = window->set_main_widget<NetworkWidget>(display_notifications);
|
||||
icon.load_from_file("/res/icons/16x16/network.png");
|
||||
auto icon = TRY(window->try_set_main_widget<NetworkWidget>(display_notifications));
|
||||
icon->load_from_file("/res/icons/16x16/network.png");
|
||||
window->resize(16, 16);
|
||||
window->show();
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue