libnm: add assertion to NMObject that a dbus-object is set

The libnm cache types don't have public _new() functions.
However, such types can be easily created using g_object_new()
directly from user code.

Such a usage is not supported. Add an assertion that a valid
dbus-object is present.

(cherry picked from commit 556b7c3b45)
This commit is contained in:
Thomas Haller 2017-03-08 08:16:44 +01:00
parent 8a857c4475
commit a006361fca

View file

@ -1202,6 +1202,8 @@ set_property (GObject *object, guint prop_id,
case PROP_DBUS_OBJECT:
/* Construct only */
priv->object = g_value_dup_object (value);
if (!priv->object)
g_return_if_reached ();
break;
case PROP_DBUS_OBJECT_MANAGER:
/* Construct only */