mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-09 00:40:19 +01:00
settings: only update transient secrets if they exist
Otherwise here the transient_secrets GHashTable will be NULL, and g_hash_table_iter_init() doesn't like that much.
This commit is contained in:
parent
a2dcf524bb
commit
e75f5bc862
1 changed files with 7 additions and 5 deletions
|
|
@ -336,11 +336,13 @@ nm_settings_connection_replace_settings (NMSettingsConnection *self,
|
|||
update_secrets_cache (self);
|
||||
|
||||
/* And add the transient secrets back */
|
||||
g_hash_table_iter_init (&iter, transient_secrets);
|
||||
while (g_hash_table_iter_next (&iter, (gpointer) &setting_name, (gpointer) &setting_hash)) {
|
||||
setting = nm_connection_get_setting_by_name (NM_CONNECTION (self), setting_name);
|
||||
if (setting)
|
||||
nm_setting_update_secrets (setting, setting_hash, NULL);
|
||||
if (transient_secrets) {
|
||||
g_hash_table_iter_init (&iter, transient_secrets);
|
||||
while (g_hash_table_iter_next (&iter, (gpointer) &setting_name, (gpointer) &setting_hash)) {
|
||||
setting = nm_connection_get_setting_by_name (NM_CONNECTION (self), setting_name);
|
||||
if (setting)
|
||||
nm_setting_update_secrets (setting, setting_hash, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
nm_settings_connection_recheck_visibility (self);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue