File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -164,7 +164,11 @@ function* handleUsbConnectPybricks(hotPlugDevice?: USBDevice): Generator {
164164 // REVISIT: For now, we are making the assumption that there is only one
165165 // configuration and it is already selected and that it contains a Pybricks
166166 // interface.
167- if ( usbDevice . configuration === null && usbDevice . configurations . length > 0 ) {
167+
168+ if (
169+ ( usbDevice . configuration === undefined || usbDevice . configuration === null ) &&
170+ usbDevice . configurations . length > 0
171+ ) {
168172 const [ , selectErr ] = yield * call ( ( ) =>
169173 maybe (
170174 usbDevice . selectConfiguration (
@@ -181,7 +185,7 @@ function* handleUsbConnectPybricks(hotPlugDevice?: USBDevice): Generator {
181185 }
182186
183187 assert (
184- usbDevice . configuration !== undefined ,
188+ usbDevice . configuration !== undefined && usbDevice . configuration !== null ,
185189 'USB device configuration is undefined' ,
186190 ) ;
187191 assert (
You can’t perform that action at this time.
0 commit comments