diff --git a/libnm-util/nm-setting.c b/libnm-util/nm-setting.c index 4df2bced1d..105981bc34 100644 --- a/libnm-util/nm-setting.c +++ b/libnm-util/nm-setting.c @@ -349,12 +349,6 @@ nm_setting_to_hash (NMSetting *setting, NMSettingHashFlags flags) } g_free (property_specs); - /* Don't return empty hashes, except for base types */ - if (g_hash_table_size (hash) < 1 && !_nm_setting_is_base_type (setting)) { - g_hash_table_destroy (hash); - hash = NULL; - } - return hash; } diff --git a/libnm-util/tests/test-secrets.c b/libnm-util/tests/test-secrets.c index 085f10bfc4..fb0ad4c7e5 100644 --- a/libnm-util/tests/test-secrets.c +++ b/libnm-util/tests/test-secrets.c @@ -681,7 +681,7 @@ test_update_secrets_whole_connection_empty_base_setting (void) connection = wifi_connection_new (); secrets = nm_connection_to_hash (connection, NM_SETTING_HASH_FLAG_ONLY_SECRETS); - g_assert_cmpint (g_hash_table_size (secrets), ==, 1); + g_assert_cmpint (g_hash_table_size (secrets), ==, 3); g_assert (g_hash_table_lookup (secrets, NM_SETTING_WIRELESS_SETTING_NAME)); success = nm_connection_update_secrets (connection,