From 411cb363444177369e55e98d613ae35ae7bddd81 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Mon, 23 Apr 2012 14:30:42 -0500 Subject: [PATCH] libnm-glib: protect against potentially NULL changed property values (rh #808784) No idea *why* they're NULL, unless perhaps that dbus-glib can't demarshal the variants for some reason, but until we know why at least log the problem so we know what properties the issue might affect. --- libnm-glib/nm-object.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/libnm-glib/nm-object.c b/libnm-glib/nm-object.c index fc9d7f868a..43f5dec71e 100644 --- a/libnm-glib/nm-object.c +++ b/libnm-glib/nm-object.c @@ -844,8 +844,14 @@ process_properties_changed (NMObject *self, GHashTable *properties, gboolean syn return; g_hash_table_iter_init (&iter, properties); - while (g_hash_table_iter_next (&iter, &name, &value)) - handle_property_changed (self, name, value, synchronously); + while (g_hash_table_iter_next (&iter, &name, &value)) { + if (value) + handle_property_changed (self, name, value, synchronously); + else { + g_warning ("%s:%d %s(): object %s property '%s' value is unexpectedly NULL", + __FILE__, __LINE__, __func__, G_OBJECT_TYPE_NAME (self), (const char *) name); + } + } } static void