diff --git a/libnm/nm-object.c b/libnm/nm-object.c index 3784fd15b5..0f1b966b47 100644 --- a/libnm/nm-object.c +++ b/libnm/nm-object.c @@ -554,8 +554,7 @@ _nm_object_create (GType type, DBusGConnection *connection, const char *path) object = g_object_new (type, NM_OBJECT_PATH, path, NULL); - if (NM_IS_OBJECT (object)) - _nm_object_cache_add (NM_OBJECT (object)); + _nm_object_cache_add (NM_OBJECT (object)); if (!g_initable_init (G_INITABLE (object), NULL, &error)) { dbgmsg ("Could not create object for %s: %s", path, error->message); g_error_free (error); @@ -624,8 +623,7 @@ async_got_type (GType type, gpointer user_data) object = g_object_new (type, NM_OBJECT_PATH, async_data->path, NULL); - if (NM_IS_OBJECT (object)) - _nm_object_cache_add (NM_OBJECT (object)); + _nm_object_cache_add (NM_OBJECT (object)); g_async_initable_init_async (G_ASYNC_INITABLE (object), G_PRIORITY_DEFAULT, NULL, async_inited, async_data); }