From a3269dde952974554155b751db54603cedad9a76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Thu, 14 Jun 2018 17:43:27 +0200 Subject: [PATCH] idle-monitor: NULL check cached InhibitedActions property variant We might not have a cached "InhibitedActions" property available for us, so do as elsewhere in this file and NULL check before processing it. https://gitlab.gnome.org/GNOME/mutter/merge_requests/130 --- src/backends/meta-idle-monitor.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/backends/meta-idle-monitor.c b/src/backends/meta-idle-monitor.c index 91075ff42..76a7ee786 100644 --- a/src/backends/meta-idle-monitor.c +++ b/src/backends/meta-idle-monitor.c @@ -263,8 +263,11 @@ meta_idle_monitor_init (MetaIdleMonitor *monitor) v = g_dbus_proxy_get_cached_property (monitor->session_proxy, "InhibitedActions"); - monitor->inhibited = g_variant_get_uint32 (v) & GSM_INHIBITOR_FLAG_IDLE; - g_variant_unref (v); + if (v) + { + monitor->inhibited = g_variant_get_uint32 (v) & GSM_INHIBITOR_FLAG_IDLE; + g_variant_unref (v); + } } /**