Node-RED digitaloutput node missing break statement.

Supporting Browser-based Javascript and Node.js
Post Reply
jnbastoky
Phidgetly
Posts: 16
Joined: Sun Apr 15, 2018 9:03 am
Contact:

Node-RED digitaloutput node missing break statement.

Post by jnbastoky »

In the Node-RED library phidget22-digitalout.js is missing the break; statement at the end of case 'setState' (line 46). This is causing the default case to get executed even through setState matches and is therefore generating an incorrect error.
jnbastoky
Phidgetly
Posts: 16
Joined: Sun Apr 15, 2018 9:03 am
Contact:

Re: Node-RED digitaloutput node missing break statement.

Post by jnbastoky »

here's the patch

Code: Select all

--- node_modules/node-red-contrib-phidget22/dist/phidget22-digitaloutput.js
+++ phidget22-digitaloutput.js
@@ -43,6 +43,7 @@
                 }
                 case 'setState': {
                     invokeMethod(function () { var _a; return digitalOutput.setState((_a = msg.payload) === null || _a === void 0 ? void 0 : _a.state); }, 'setState');
+                    break;
                 }
                 default: {
                     node.error('Unsupported message topic: ' + msg.topic);
jnbastoky
Phidgetly
Posts: 16
Joined: Sun Apr 15, 2018 9:03 am
Contact:

Re: Node-RED digitaloutput node missing break statement.

Post by jnbastoky »

Is this Node Red module still supported? Any chance this will get patched?
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest