[mutter/gnome-3-28] idle-monitor: NULL check cached InhibitedActions property variant



commit b44f93ee9ba2499601e2f6d037145851fc5a9abc
Author: Jonas Ã…dahl <jadahl gmail com>
Date:   Thu Jun 14 15:43:27 2018 +0000

    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
    
    
    (cherry picked from commit a3269dde952974554155b751db54603cedad9a76)

 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 46cf8cd76..7a217f761 100644
--- a/src/backends/meta-idle-monitor.c
+++ b/src/backends/meta-idle-monitor.c
@@ -262,8 +262,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]