From 5aa204edec9541dd47344aee228bd5f94121213d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= Date: Fri, 27 Feb 2015 22:39:04 +0100 Subject: [PATCH] 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 --- clients/tui/nmt-connect-connection-list.c | 8 +++++--- 1 file 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;