Skip to content

Commit

Permalink
try catch on transfer cancel
Browse files Browse the repository at this point in the history
  • Loading branch information
jiahuang authored and heavyk committed Oct 6, 2015
1 parent 6f18d66 commit a59c120
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion usb.js
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,11 @@ Endpoint.prototype.stopPoll = function(cb){
throw new Error('Polling is not active.');
}
for (var i=0; i<this.pollTransfers.length; i++){
this.pollTransfers[i].cancel()
try {
this.pollTransfers[i].cancel()
} catch (err) {
this.emit('error', err);
}
}
this.pollActive = false
if (cb) this.once('end', cb);
Expand Down

0 comments on commit a59c120

Please sign in to comment.