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 @@ -179,12 +179,16 @@ function* handleUsbConnectPybricks(hotPlugDevice?: USBDevice): Generator {
179179 }
180180 }
181181
182+ // usbDevice.configuration as non-null because we either just selected it or
183+ // Now we know that usbDevice.configuration can never be null, as firware and
184+ // a "1" configuration exists
185+
182186 assert (
183- usbDevice . configuration . interfaces . length > 0 ,
187+ usbDevice . configuration ! . interfaces . length > 0 ,
184188 'USB device has no interfaces' ,
185189 ) ;
186190
187- const iface = usbDevice . configuration . interfaces . find (
191+ const iface = usbDevice . configuration ! . interfaces . find (
188192 ( iface ) =>
189193 iface . alternate . interfaceClass === pybricksUsbClass &&
190194 iface . alternate . interfaceSubclass === pybricksUsbSubclass &&
You can’t perform that action at this time.
0 commit comments