test: don't crash libnm-glib-test if there aren't any APs

This commit is contained in:
Richard Hughes
2011-02-18 11:30:36 -06:00
committed by Dan Williams
parent 6ef8a6d12d
commit 0b8dd709b0

View File

@@ -203,7 +203,7 @@ dump_wireless (NMDeviceWifi *device)
g_print ("AccessPoints:\n"); g_print ("AccessPoints:\n");
aps = nm_device_wifi_get_access_points (device); aps = nm_device_wifi_get_access_points (device);
for (i = 0; i < aps->len; i++) { for (i = 0; aps && (i < aps->len); i++) {
dump_access_point (NM_ACCESS_POINT (g_ptr_array_index (aps, i))); dump_access_point (NM_ACCESS_POINT (g_ptr_array_index (aps, i)));
g_print ("\n"); g_print ("\n");
} }