catch possible non-property in BBB node

This commit is contained in:
Dave Conway-Jones
2016-01-29 20:07:17 +00:00
parent d7be242477
commit 9ba84c4908
2 changed files with 2 additions and 2 deletions

View File

@@ -246,7 +246,7 @@ module.exports = function (RED) {
bonescript.detachInterrupt(node._pin);
process.nextTick(function () {
setPinMode(node._pin, bonescript.INPUT, function (response, pin) {
if (response.value === true) {
if (response.hasOwnProperty("value") && response.value === true) {
bonescript.digitalRead(node._pin, function (err, x) {
// Initialise the currentState and lastActiveTime variables based on the value read
node.currentState = Number(x.value);