usb.findByIds will return undefined if the device is not plugged in. The second line in the snippet below causes a error to be thrown TypeError: Cannot read property 'open' of undefined.
device = usb.findByIds(this.vid, this.pid);
device.open();
Would it be possible it either return a error to the callback or throw a exception? If you could state your preference I don't mind raising a PR.
usb.findByIdswill returnundefinedif the device is not plugged in. The second line in the snippet below causes a error to be thrownTypeError: Cannot read property 'open' of undefined.Would it be possible it either return a error to the callback or throw a exception? If you could state your preference I don't mind raising a PR.