From 95ab69b761293993c27d64137b9c5163d4773de0 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Wed, 12 Oct 2016 19:50:32 +0200 Subject: libnm: coerce empty strings to NULL for D-Bus properties On D-Bus level, string (s) or object paths (o) cannot be NULL. Thus, whenver server exposes such an object, it gets automatically coerced to "" or "/", respectively. On client side, libnm should coerce certain properties back, for which "" is just not a sensible value. For example, an empty NM_DEVICE_ETHERNET_HW_ADDRESS should be instead exposed as NULL. Technically, this is an API change. However, all users were well advised to expect both NULL and "" as possible return values and handle them accordingly. --- libnm/nm-device-bt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libnm/nm-device-bt.c') diff --git a/libnm/nm-device-bt.c b/libnm/nm-device-bt.c index 2c039d941e..f41b7abd8c 100644 --- a/libnm/nm-device-bt.c +++ b/libnm/nm-device-bt.c @@ -65,7 +65,7 @@ nm_device_bt_get_hw_address (NMDeviceBt *device) { g_return_val_if_fail (NM_IS_DEVICE_BT (device), NULL); - return NM_DEVICE_BT_GET_PRIVATE (device)->hw_address; + return nm_str_not_empty (NM_DEVICE_BT_GET_PRIVATE (device)->hw_address); } /** -- cgit v1.2.1