[mutter] idle-monitor: NULL check cached InhibitedActions property variant



commit a3269dde952974554155b751db54603cedad9a76
Author: Jonas Ådahl <jadahl gmail com>
Date:   Thu Jun 14 17:43:27 2018 +0200

    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);
+    }
 }
 
 /**


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]