@5minds/node-red-contrib-processcube 1.2.1-develop-3f34f2-m1xw7p4r → 1.2.2-develop-40a813-m1xxcgt0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,10 +3,17 @@ module.exports = function (RED) {
3
3
  RED.nodes.createNode(this, config);
4
4
  var node = this;
5
5
 
6
- var flowContext = node.context().flow;
7
- var eventEmitter = flowContext.get('emitter');
6
+ const flowContext = node.context().flow;
7
+ let eventEmitter = null;
8
8
 
9
9
  node.on('input', function (msg) {
10
+ eventEmitter = flowContext.get('emitter');
11
+
12
+ if (!eventEmitter) {
13
+ flowContext.set('emitter', new EventEmitter());
14
+ eventEmitter = flowContext.get('emitter');
15
+ }
16
+
10
17
  const flowNodeInstanceId = msg.flowNodeInstanceId;
11
18
 
12
19
  let msgError = msg.error;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@5minds/node-red-contrib-processcube",
3
- "version": "1.2.1-develop-3f34f2-m1xw7p4r",
3
+ "version": "1.2.2-develop-40a813-m1xxcgt0",
4
4
  "license": "MIT",
5
5
  "description": "Node-RED nodes for ProcessCube",
6
6
  "scripts": {