diff options
author | Thomas Haller <thaller@redhat.com> | 2017-06-29 09:43:25 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2017-06-29 09:46:21 +0200 |
commit | c4ef6f2d2f84be6317ad014e2f27f0191e40f897 (patch) | |
tree | 570fffe98787cb2e7d4176bff9d3cc0f19597fa1 | |
parent | 5fad8aeb5103ef04136d498f68b90ad10765c0cb (diff) | |
download | NetworkManager-c4ef6f2d2f84be6317ad014e2f27f0191e40f897.tar.gz |
cli: fix assertion in tab completion for gen_property_names()
$ nmcli connection edit type ethernet
nmcli> describe x.y<TAB>
(process:29799): libnmc-CRITICAL **: nm_meta_setting_info_editor_find_by_name: assertion 'setting_name' failed
-rw-r--r-- | clients/cli/connections.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/clients/cli/connections.c b/clients/cli/connections.c index 84f80741c9..0f771c2084 100644 --- a/clients/cli/connections.c +++ b/clients/cli/connections.c @@ -5201,9 +5201,13 @@ gen_property_names (const char *text, int state) valid_settings_main, valid_settings_slave, NULL); - setting = nm_meta_setting_info_editor_new_setting (nm_meta_setting_info_editor_find_by_name (setting_name, FALSE), - NM_META_ACCESSOR_SETTING_INIT_TYPE_DEFAULT); - } else { + if (setting_name) { + setting = nm_meta_setting_info_editor_new_setting (nm_meta_setting_info_editor_find_by_name (setting_name, FALSE), + NM_META_ACCESSOR_SETTING_INIT_TYPE_DEFAULT); + } + } + + if (!setting) { /* Else take the current setting, if any */ setting = nmc_tab_completion.setting ? g_object_ref (nmc_tab_completion.setting) : NULL; } |