summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLubomir Rintel <lkundrak@v3.sk>2018-08-09 14:55:30 +0200
committerLubomir Rintel <lkundrak@v3.sk>2018-10-17 17:05:05 +0200
commit0c10ae713b511c432630be76f5f72db9259294c9 (patch)
treee572166514d4bec5b7e199211208c1b2ab482a20
parent4890f943bd3418b973a3cdf4b9dd747cc53689cd (diff)
downloadNetworkManager-0c10ae713b511c432630be76f5f72db9259294c9.tar.gz
core/setting: don't assume we have a connection when synthesizing a property
nm_setting_to_string() operates on the setting alone, without a connection. Tolerate that. This fixed nm_connection_dump(vlan_connection). (cherry picked from commit c39b134da1286b57f47d392cb5feaab585aca41d)
-rw-r--r--libnm-core/nm-setting.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/libnm-core/nm-setting.c b/libnm-core/nm-setting.c
index fa0125b965..6b9681b539 100644
--- a/libnm-core/nm-setting.c
+++ b/libnm-core/nm-setting.c
@@ -2037,8 +2037,12 @@ _nm_setting_get_deprecated_virtual_interface_name (NMSetting *setting,
{
NMSettingConnection *s_con;
+ if (!connection)
+ return NULL;
+
s_con = nm_connection_get_setting_connection (connection);
- g_return_val_if_fail (s_con != NULL, NULL);
+ if (!s_con)
+ return NULL;
if (nm_setting_connection_get_interface_name (s_con))
return g_variant_new_string (nm_setting_connection_get_interface_name (s_con));