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 68dacb531b
commit f5f0ff0a2f

View File

@ -375,6 +375,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);
}