From f125d52622110ba5b813498e0d7b1eb705e535ef Mon Sep 17 00:00:00 2001 From: creator1creeper1 Date: Sat, 25 Dec 2021 13:31:15 +0100 Subject: [PATCH] Applets/Network: Propagate errors with try_set_main_widget Use try_set_main_widget instead of set_main_widget. --- Userland/Applets/Network/main.cpp | 4 ++-- 1 file 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 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(display_notifications); - icon.load_from_file("/res/icons/16x16/network.png"); + auto icon = TRY(window->try_set_main_widget(display_notifications)); + icon->load_from_file("/res/icons/16x16/network.png"); window->resize(16, 16); window->show();