Skip to content

Commit

Permalink
Null Exception Error
Browse files Browse the repository at this point in the history
FIXED: Issue where HID is release before stop causing exception to be fired.
  • Loading branch information
hopejr committed Aug 11, 2020
1 parent 154a730 commit 1028d80
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions lib/Shuttle.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,10 @@ class Shuttle extends EventEmitter {
stop () {
if (this._connected) {
usbDetect.stopMonitoring()
this._hid.close()
this._hid = null
if (this._hid !== null) {
this._hid.close()
this._hid = null
}
this._connected = false
}
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "shuttle-control-usb",
"version": "1.0.0",
"version": "1.0.1",
"description": "NodeJS Interface for Contour ShuttleXpress and ShuttlePro V2",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit 1028d80

Please sign in to comment.