File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -188,7 +188,7 @@ export class USB implements Transport {
188188 */
189189 public read ( ) : Promise < DataView > {
190190 return new Promise ( ( resolve , reject ) => {
191- if ( ! this . interfaceNumber ) return reject ( "No device opened" ) ;
191+ if ( this . interfaceNumber === undefined ) return reject ( "No device opened" ) ;
192192
193193 // Use endpoint if it exists
194194 if ( this . endpointIn ) {
@@ -225,7 +225,7 @@ export class USB implements Transport {
225225 const buffer = this . bufferSourceToBuffer ( extended ) ;
226226
227227 return new Promise ( ( resolve , reject ) => {
228- if ( ! this . interfaceNumber ) return reject ( "No device opened" ) ;
228+ if ( this . interfaceNumber === undefined ) return reject ( "No device opened" ) ;
229229
230230 // Use endpoint if it exists
231231 if ( this . endpointOut ) {
Original file line number Diff line number Diff line change @@ -140,7 +140,7 @@ export class WebUSB implements Transport {
140140 * @returns Promise of DataView
141141 */
142142 public read ( ) : Promise < DataView > {
143- if ( ! this . interfaceNumber ) return Promise . reject ( "No device opened" ) ;
143+ if ( this . interfaceNumber === undefined ) return Promise . reject ( "No device opened" ) ;
144144
145145 // Use endpoint if it exists
146146 if ( this . endpointIn ) {
@@ -171,7 +171,7 @@ export class WebUSB implements Transport {
171171 * @returns Promise
172172 */
173173 public write ( data : BufferSource ) : Promise < void > {
174- if ( ! this . interfaceNumber ) return Promise . reject ( "No device opened" ) ;
174+ if ( this . interfaceNumber === undefined ) return Promise . reject ( "No device opened" ) ;
175175
176176 const buffer = this . extendBuffer ( data , this . packetSize ) ;
177177
You can’t perform that action at this time.
0 commit comments