diff options
author | Jiří Klimeš <jklimes@redhat.com> | 2015-02-27 22:39:04 +0100 |
---|---|---|
committer | Jiří Klimeš <jklimes@redhat.com> | 2015-02-27 22:52:10 +0100 |
commit | 5aa204edec9541dd47344aee228bd5f94121213d (patch) | |
tree | d32ce54a700390f92ec9a80f82aaf57ee7041878 | |
parent | f610ae726535f0cf51f13d86918bdcee066f83c0 (diff) | |
download | NetworkManager-5aa204edec9541dd47344aee228bd5f94121213d.tar.gz |
tui: fix a crash when connection list for activation is empty (rh #1119663)
When there are no connections for a device, do not add the header.
https://bugzilla.redhat.com/show_bug.cgi?id=1119663
-rw-r--r-- | clients/tui/nmt-connect-connection-list.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/clients/tui/nmt-connect-connection-list.c b/clients/tui/nmt-connect-connection-list.c index 0805806639..88502ba7c8 100644 --- a/clients/tui/nmt-connect-connection-list.c +++ b/clients/tui/nmt-connect-connection-list.c @@ -503,9 +503,11 @@ nmt_connect_connection_list_rebuild (NmtConnectConnectionList *list) for (diter = nmt_devices; diter; diter = diter->next) { nmtdev = diter->data; - if (diter != nmt_devices) - nmt_newt_listbox_append (listbox, "", NULL); - nmt_newt_listbox_append (listbox, nmtdev->name, NULL); + if (nmtdev->conns) { + if (diter != nmt_devices) + nmt_newt_listbox_append (listbox, "", NULL); + nmt_newt_listbox_append (listbox, nmtdev->name, NULL); + } for (citer = nmtdev->conns; citer; citer = citer->next) { nmtconn = citer->data; |