libnm-glib: fix up empty object path demarshalling after 8afce8590a
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.
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user