cli: fix nmcli device wifi with no Wi-Fi devices available

Fixes: db396cea9d ('cli: rework do_device_wifi_list() to scan and print Wi-Fi list')
This commit is contained in:
Thomas Haller 2020-03-20 10:38:09 +01:00
parent 8d6998cb77
commit c03f88575d

View file

@ -3170,6 +3170,16 @@ do_device_wifi_list (NmCli *nmc, int argc, char **argv)
return NMC_RESULT_ERROR_NOT_FOUND;
}
if (!devices[0]) {
if (bssid_user) {
nmc->return_value = NMC_RESULT_ERROR_NOT_FOUND;
g_string_printf (nmc->return_text, _("Error: Access point with bssid '%s' not found."),
bssid_user);
return NMC_RESULT_ERROR_NOT_FOUND;
}
return NMC_RESULT_SUCCESS;
}
scan_info = g_slice_new (ScanInfo);
*scan_info = (ScanInfo) {
.out_indices = g_array_ref (out_indices),