summary refs log tree commit diff
path: root/libnm-core/nm-core-internal.h
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2017-07-12 17:57:30 +0200
committerMichael Biebl <biebl@debian.org>2017-07-12 17:57:30 +0200
commitb9f0451fa35393ceedf6d9d20b78c43578ebea5d (patch)
tree417afcdd717020ad44e25fadee4b89de23316e83 /libnm-core/nm-core-internal.h
parentc333f062ddcba9b35330647bf6cbd0a07f2d786e (diff)
New upstream version 1.8.2 upstream/1.8.2
Diffstat (limited to 'libnm-core/nm-core-internal.h')
-rw-r--r--libnm-core/nm-core-internal.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/libnm-core/nm-core-internal.h b/libnm-core/nm-core-internal.h
index ac292bfc..91967ce3 100644
--- a/libnm-core/nm-core-internal.h
+++ b/libnm-core/nm-core-internal.h
@@ -343,6 +343,24 @@ _nm_setting_bond_get_option_type (NMSettingBond *setting, const char *name);
 
 /*****************************************************************************/
 
+/* nm_connection_get_uuid() asserts against NULL, which is the right thing to
+ * do in order to catch bugs. However, sometimes that behavior is inconvenient.
+ * Just try or return NULL. */
+
+static inline const char *
+_nm_connection_get_id (NMConnection *connection)
+{
+	return connection ? nm_connection_get_id (connection) : NULL;
+}
+
+static inline const char *
+_nm_connection_get_uuid (NMConnection *connection)
+{
+	return connection ? nm_connection_get_uuid (connection) : NULL;
+}
+
+/*****************************************************************************/
+
 typedef enum {
 	NM_BOND_MODE_UNKNOWN = 0,
 	NM_BOND_MODE_ROUNDROBIN,