From 415349c8526ca4485f6bd37be7c19579acb4c8d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Sat, 9 Jul 2022 14:01:17 +0200 Subject: [PATCH] systemActions: Disable power-off if querying support fails Treating failure as success is weird. It's also most likely wrong, as the most likely reason is that gnome-session isn't running. Part-of: --- js/misc/systemActions.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/js/misc/systemActions.js b/js/misc/systemActions.js index b43f93a3d..6d0e0497c 100644 --- a/js/misc/systemActions.js +++ b/js/misc/systemActions.js @@ -331,10 +331,7 @@ const SystemActions = GObject.registerClass({ _updateHaveShutdown() { this._session.CanShutdownRemote((result, error) => { - if (error) - return; - - this._canHavePowerOff = result[0]; + this._canHavePowerOff = error ? false : result[0]; this._updatePowerOff(); }); }