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
(cherry picked from commit 5aa204edec)
This commit is contained in:
Jiří Klimeš 2015-02-27 22:39:04 +01:00 committed by Dan Williams
parent 785dd7c21a
commit 2a72527c44

View file

@ -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;