Merge pull request #10 from taxilian/master

Check for NULL device on enumeration on Mac.

On Mac, hid_enumerate can crash if the device is unplugged during enumeration.
This commit is contained in:
signal11
2011-08-08 18:37:38 -07:00
+3
View File
@@ -320,6 +320,9 @@ struct hid_device_info HID_API_EXPORT *hid_enumerate(unsigned short vendor_id,
IOHIDDeviceRef dev = device_array[i];
if (!dev) {
continue;
}
dev_vid = get_vendor_id(dev);
dev_pid = get_product_id(dev);