summaryrefslogtreecommitdiff
path: root/libnm-glib/nm-device-wifi.c
diff options
context:
space:
mode:
authorDan Williams <dcbw@redhat.com>2011-06-01 12:52:20 -0500
committerDan Williams <dcbw@redhat.com>2011-06-01 12:55:54 -0500
commit10ea7a911ce66c8f70eb811b61c9c75682df541c (patch)
treec5a6b008769a2d42f938f237a609a74d4b7ac81a /libnm-glib/nm-device-wifi.c
parenta70d87d84e57065c619ddf9ee2b913d9e077996b (diff)
downloadNetworkManager-10ea7a911ce66c8f70eb811b61c9c75682df541c.tar.gz
libnm-glib: fix up empty object path demarshalling after 8afce8590ab8f08f0703a9f0a4cf8c6fbfe87fb6
G_VALUE_HOLDS will fail if the value variable is NULL, so we only want to check that the GValue holds the right type if the value is valid. NULL means "no object path" in demarshallers.
Diffstat (limited to 'libnm-glib/nm-device-wifi.c')
-rw-r--r--libnm-glib/nm-device-wifi.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/libnm-glib/nm-device-wifi.c b/libnm-glib/nm-device-wifi.c
index 9877f94ff3..7d0e1b9f6d 100644
--- a/libnm-glib/nm-device-wifi.c
+++ b/libnm-glib/nm-device-wifi.c
@@ -637,12 +637,10 @@ demarshal_active_ap (NMObject *object, GParamSpec *pspec, GValue *value, gpointe
NMAccessPoint *ap = NULL;
DBusGConnection *connection;
- if (!G_VALUE_HOLDS (value, DBUS_TYPE_G_OBJECT_PATH))
- return FALSE;
-
- priv->got_active_ap = TRUE;
-
if (value) {
+ if (!G_VALUE_HOLDS (value, DBUS_TYPE_G_OBJECT_PATH))
+ return FALSE;
+
path = g_value_get_boxed (value);
if (path) {
ap = NM_ACCESS_POINT (_nm_object_cache_get (path));
@@ -653,6 +651,8 @@ demarshal_active_ap (NMObject *object, GParamSpec *pspec, GValue *value, gpointe
}
}
+ priv->got_active_ap = TRUE;
+
if (priv->active_ap) {
g_object_unref (priv->active_ap);
priv->active_ap = NULL;