mirror of
https://github.com/edu4rdshl/gnome-shell.git
synced 2026-07-17 23:24:51 +00:00
loginManager: Handle unset XDG_SESSION_ID more gracefully
While certain functionality won't be available when running outside a (logind) user session, that's still better than crashing ... https://bugzilla.gnome.org/show_bug.cgi?id=788046
This commit is contained in:
parent
ab0e98dfdd
commit
de4c0bdca6
1 changed files with 7 additions and 1 deletions
|
|
@ -119,7 +119,13 @@ var LoginManagerSystemd = new Lang.Class({
|
|||
return;
|
||||
}
|
||||
|
||||
this._proxy.GetSessionRemote(GLib.getenv('XDG_SESSION_ID'), Lang.bind(this,
|
||||
let sessionId = GLib.getenv('XDG_SESSION_ID');
|
||||
if (!sessionId) {
|
||||
log('Unset XDG_SESSION_ID, getCurrentSessionProxy() called outside a user session.');
|
||||
return;
|
||||
}
|
||||
|
||||
this._proxy.GetSessionRemote(sessionId, Lang.bind(this,
|
||||
function(result, error) {
|
||||
if (error) {
|
||||
logError(error, 'Could not get a proxy for the current session');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue