summary refs log tree commit diff
path: root/libnm-glib/nm-device-wifi.c
diff options
context:
space:
mode:
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 9877f94f..7d0e1b9f 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;