summaryrefslogtreecommitdiff
path: root/Userland/Applets/Network/main.cpp
diff options
context:
space:
mode:
authorcreator1creeper1 <creator1creeper1@airmail.cc>2021-12-25 13:31:15 +0100
committerAndreas Kling <kling@serenityos.org>2022-01-03 16:01:42 +0100
commitf125d52622110ba5b813498e0d7b1eb705e535ef (patch)
tree42ca8cb35a5823139aaa702cdc3a104ec9b7af3f /Userland/Applets/Network/main.cpp
parent43ecf1d4297f1bd8d9075cc4cbef9874b998cbf7 (diff)
downloadserenity-f125d52622110ba5b813498e0d7b1eb705e535ef.zip
Applets/Network: Propagate errors with try_set_main_widget
Use try_set_main_widget instead of set_main_widget.
Diffstat (limited to 'Userland/Applets/Network/main.cpp')
-rw-r--r--Userland/Applets/Network/main.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/Userland/Applets/Network/main.cpp b/Userland/Applets/Network/main.cpp
index edae11ced7..9e3d38085f 100644
--- a/Userland/Applets/Network/main.cpp
+++ b/Userland/Applets/Network/main.cpp
@@ -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();