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-team.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-team.c')
-rw-r--r-- | libnm/nm-device-team.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libnm/nm-device-team.c b/libnm/nm-device-team.c index 8179bd52f4..0c5383deea 100644 --- a/libnm/nm-device-team.c +++ b/libnm/nm-device-team.c @@ -66,7 +66,7 @@ nm_device_team_get_hw_address (NMDeviceTeam *device) { g_return_val_if_fail (NM_IS_DEVICE_TEAM (device), NULL); - return NM_DEVICE_TEAM_GET_PRIVATE (device)->hw_address; + return nm_str_not_empty (NM_DEVICE_TEAM_GET_PRIVATE (device)->hw_address); } /** @@ -119,7 +119,7 @@ nm_device_team_get_config (NMDeviceTeam *device) { g_return_val_if_fail (NM_IS_DEVICE_TEAM (device), NULL); - return NM_DEVICE_TEAM_GET_PRIVATE (device)->config; + return nm_str_not_empty (NM_DEVICE_TEAM_GET_PRIVATE (device)->config); } static const char * |