Skip to content

Commit

Permalink
Fix homebridge crash as reported in issue #2
Browse files Browse the repository at this point in the history
This commit fixes the Homebridge crash when you try to lock a already
locked door, or unlock a already unlocked door.
  • Loading branch information
kodsnutten committed Jul 14, 2017
1 parent a34adce commit fbb68e0
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,11 @@ VerisureAccessory.prototype = {
}, function(value, callback, error, response){
this.log(`***** Response from ${actionValue}-operation: ${JSON.stringify(response)}`);
if (error != null) callback(error, response);
if (response && response.statusCode != 200) callback(response);
this._waitForLockStatusChangeResult(value, callback, response);
if (response && response.statusCode != 200) {
callback(response);
} else {
this._waitForLockStatusChangeResult(value, callback, response);
}
}.bind(this,value,callback))
},

Expand Down

0 comments on commit fbb68e0

Please sign in to comment.