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
This commit is contained in:
Jonas Ådahl 2018-06-14 17:43:27 +02:00
parent f2dea5d139
commit a3269dde95

View File

@ -263,9 +263,12 @@ meta_idle_monitor_init (MetaIdleMonitor *monitor)
v = g_dbus_proxy_get_cached_property (monitor->session_proxy,
"InhibitedActions");
if (v)
{
monitor->inhibited = g_variant_get_uint32 (v) & GSM_INHIBITOR_FLAG_IDLE;
g_variant_unref (v);
}
}
/**
* meta_idle_monitor_get_core: