From cbbc066d6fb566297a4e27b3fa744d89c69e4a8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Thu, 20 Oct 2022 13:04:18 +0200 Subject: [PATCH] powerProfiles: Avoid warnings on missing power-profiles-daemon GDBusProxy transparently handles the remote object appearing and vanishing. It is therefore not an error if the service is not running at the time the proxy is initialized, so we proceed and try to read the list of profiles which is null in that case, resulting in (harmless but annoying) warnings. Avoid this by only reading the initial list of profiles if the service has a name owner. https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5992 Part-of: --- js/ui/status/powerProfiles.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/js/ui/status/powerProfiles.js b/js/ui/status/powerProfiles.js index 43f6ce93f..e15208d8f 100644 --- a/js/ui/status/powerProfiles.js +++ b/js/ui/status/powerProfiles.js @@ -58,7 +58,9 @@ class PowerProfilesToggle extends QuickMenuToggle { this._syncProfiles(); this._sync(); }); - this._syncProfiles(); + + if (this._proxy.g_name_owner) + this._syncProfiles(); } this._sync(); });