summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2017-03-08 08:16:44 +0100
committerThomas Haller <thaller@redhat.com>2017-03-09 15:22:17 +0100
commita006361fca784f72f0649ad87f2390eeeabb89a5 (patch)
tree5bb2a603dd4c8ce2297b0500e454a228c7b3685e
parent8a857c4475a0ae826a7cd99e5afadb5ed3c0e253 (diff)
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 556b7c3b4597405242e5fe2a557a9dc480858dae)
-rw-r--r--libnm/nm-object.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libnm/nm-object.c b/libnm/nm-object.c
index 91ced0e4c..81a7de1e9 100644
--- a/libnm/nm-object.c
+++ b/libnm/nm-object.c
@@ -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 */