cli: fix a crash in 'nmcli d l' when no connections available for a device

The regression caused by 1dca1e3c3d
This commit is contained in:
Jiří Klimeš 2013-02-26 11:44:22 +01:00
parent 47d8db57b5
commit 5e17df86f4

View file

@ -909,7 +909,7 @@ show_device_info (gpointer data, gpointer user_data)
/* available-connections */
avail_cons = nm_device_get_available_connections (device);
ac_paths_str = g_string_new (NULL);
if (avail_cons->len) {
if (avail_cons && avail_cons->len) {
ac_arr = g_new (char *, avail_cons->len + 1);
ac_arr[avail_cons->len] = NULL;
}