monitor-manager: Fix crash when UPower is not available

Don't access the upower client if it doesn't exist

https://bugzilla.gnome.org/show_bug.cgi?id=780407
This commit is contained in:
Bastien Nocera 2017-05-31 15:17:01 +02:00
parent 28b2added7
commit 2ec91abf38

View File

@ -260,6 +260,9 @@ lid_is_closed_changed (UpClient *client,
static gboolean
meta_monitor_manager_real_is_lid_closed (MetaMonitorManager *manager)
{
if (!manager->up_client)
return FALSE;
return up_client_get_lid_is_closed (manager->up_client);
}