mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-19 07:08:54 +02:00
gnetworkmonitornm: Prevent crash
g_dbus_proxy_get_cached_property_names can return NULL if there are no cached properties, so don't try to access them in that case.
This commit is contained in:
@@ -219,6 +219,10 @@ has_property (GDBusProxy *proxy,
|
|||||||
gboolean prop_found = FALSE;
|
gboolean prop_found = FALSE;
|
||||||
|
|
||||||
props = g_dbus_proxy_get_cached_property_names (proxy);
|
props = g_dbus_proxy_get_cached_property_names (proxy);
|
||||||
|
|
||||||
|
if (!props)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
for (i = 0; props[i] != NULL; i++)
|
for (i = 0; props[i] != NULL; i++)
|
||||||
{
|
{
|
||||||
if (g_str_equal (props[i], property_name))
|
if (g_str_equal (props[i], property_name))
|
||||||
|
Reference in New Issue
Block a user