From 2ec91abf38b3b055a735318c45f7e38d9408c1be Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Wed, 31 May 2017 15:17:01 +0200 Subject: [PATCH] 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 --- src/backends/meta-monitor-manager.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/backends/meta-monitor-manager.c b/src/backends/meta-monitor-manager.c index 0d1bb05f5..eecef77bf 100644 --- a/src/backends/meta-monitor-manager.c +++ b/src/backends/meta-monitor-manager.c @@ -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); }