mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-09 07:08:02 +02:00
libnm-glib: don't crash on unknown object types
Like when an old libnm-glib is being run against a newer NM when a new device type has been added.
This commit is contained in:
parent
836f7d177e
commit
8572ecfd7c
1 changed files with 5 additions and 0 deletions
|
|
@ -445,6 +445,11 @@ _nm_object_create (GType type, DBusGConnection *connection, const char *path)
|
||||||
if (type_func)
|
if (type_func)
|
||||||
type = type_func (connection, path);
|
type = type_func (connection, path);
|
||||||
|
|
||||||
|
if (type == G_TYPE_INVALID) {
|
||||||
|
g_warning ("Could not create object for %s: unknown object type", path);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
object = g_object_new (type,
|
object = g_object_new (type,
|
||||||
NM_OBJECT_DBUS_CONNECTION, connection,
|
NM_OBJECT_DBUS_CONNECTION, connection,
|
||||||
NM_OBJECT_DBUS_PATH, path,
|
NM_OBJECT_DBUS_PATH, path,
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue