From 9ba84c490877e0812591f46fead49dc7c0275c70 Mon Sep 17 00:00:00 2001 From: Dave Conway-Jones Date: Fri, 29 Jan 2016 20:07:17 +0000 Subject: [PATCH] catch possible non-property in BBB node --- hardware/BBB/145-BBB-hardware.js | 2 +- hardware/BBB/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hardware/BBB/145-BBB-hardware.js b/hardware/BBB/145-BBB-hardware.js index 3831ab24..c2d22e4a 100644 --- a/hardware/BBB/145-BBB-hardware.js +++ b/hardware/BBB/145-BBB-hardware.js @@ -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); diff --git a/hardware/BBB/package.json b/hardware/BBB/package.json index 5407772a..cf5f6460 100644 --- a/hardware/BBB/package.json +++ b/hardware/BBB/package.json @@ -1,6 +1,6 @@ { "name" : "node-red-node-beaglebone", - "version" : "0.1.1", + "version" : "0.1.2", "description" : "A set of Node-RED nodes to interface to the GPIO pins of a Beaglebone Black board", "dependencies" : { "octalbonescript":"^1.1.*"