diff options
author | Thomas Haller <thaller@redhat.com> | 2016-10-12 19:50:32 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2016-10-24 10:14:02 +0200 |
commit | 95ab69b761293993c27d64137b9c5163d4773de0 (patch) | |
tree | e0f9f1c06c212d66d534bcfd47b53863557f94c9 /libnm/nm-device-bt.c | |
parent | 21d7aa92044b458028e1968cd09ec015edf977ec (diff) | |
download | NetworkManager-95ab69b761293993c27d64137b9c5163d4773de0.tar.gz |
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.
Diffstat (limited to 'libnm/nm-device-bt.c')
-rw-r--r-- | libnm/nm-device-bt.c | 2 |
1 files changed, 1 insertions, 1 deletions
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); } /** |