Skip to content

Commit

Permalink
Don't show any error dialog when no device are connected
Browse files Browse the repository at this point in the history
  • Loading branch information
Dadoum committed Oct 27, 2023
1 parent bbd37b6 commit 88f658d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion source/imobiledevice/package.d
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,11 @@ public class iDevice {
public static @property iDeviceInfo[] deviceList() {
int len;
idevice_info_t* names;
idevice_get_device_list_extended(&names, &len).assertSuccess();
auto res = idevice_get_device_list_extended(&names, &len);
if (res == idevice_error_t.IDEVICE_E_NO_DEVICE) {
return [];
}
res.assertSuccess();
return names[0..len].map!((s) => iDeviceInfo(cast(string) s.udid.fromStringz, cast(iDeviceConnectionType) s.conn_type)).array;
}

Expand Down

0 comments on commit 88f658d

Please sign in to comment.