thegecko / webusb

Node.js implementation of the WebUSB Specification
https://thegecko.github.io/webusb/
MIT License
183 stars 27 forks source link

issue-21 prevent crash in allConfigDescriptor #22

Closed abeck70 closed 6 years ago

abeck70 commented 6 years ago

by preceding with catch-able error in configDescriptor call

abeck70 commented 6 years ago

Test successfully with a custom webusb device

thegecko commented 6 years ago

Thanks for the PR!

Can this be simplified to just:

            try {
                configDescriptor = device.configDescriptor;
                deviceDescriptor = device.deviceDescriptor;
                configs = device.allConfigDescriptors;
            } catch (_e) {
                return resolve(null);
            }
abeck70 commented 6 years ago

Ah yes of course. Simplified and re-tested.

thegecko commented 6 years ago

Awesome! Fixes #21