Skip to content

Commit

Permalink
Fix bug in node 0.12.x where clearTimeout expects argument to have an…
Browse files Browse the repository at this point in the history
… id property.
  • Loading branch information
rwaldron committed Jul 15, 2015
1 parent 662e9f6 commit 84ede7b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/board.js
Original file line number Diff line number Diff line change
Expand Up @@ -407,8 +407,7 @@ function broadcast(err, type, io) {
// 10 seconds of the connect event, then it's likely
// there is an issue with the device or firmware.
if (!IS_TEST_MODE) {
this.timer = setTimeout(function() {

this.timer = setTimeout(function() {
this.error(
"Device or Firmware Error",
"A timeout occurred while connecting to the Board. \n\n" +
Expand All @@ -422,7 +421,9 @@ function broadcast(err, type, io) {
}

if (type === "ready") {
clearTimeout(this.timer);
if (this.timer) {
clearTimeout(this.timer);
}

// Update instance `ready` flag
this.isReady = true;
Expand Down

0 comments on commit 84ede7b

Please sign in to comment.