@gregoriusrippenstein/node-red-contrib-introspection 0.15.7 → 0.15.8

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.
@@ -11,16 +11,17 @@ module.exports = function (RED) {
11
11
 
12
12
  function msgTracerOnReceiveHook(evnt) {
13
13
  try {
14
- let nde = RED.nodes.getNode(evnt.destination.id)
15
-
16
- nde.status({ fill: "green", shape: "ring", text: "msg received" })
17
- setTimeout(() => { nde.status({}) }, 1000)
18
-
19
14
  RED.comms.publish("msgtracer:node-received",
20
15
  RED.util.encodeObject({
21
16
  nodeid: evnt.destination.id
22
17
  })
23
18
  )
19
+
20
+ let nde = RED.nodes.getNode(evnt.destination.id)
21
+ if (nde) {
22
+ nde.status({ fill: "green", shape: "ring", text: "msg received" })
23
+ setTimeout(() => { nde.status({}) }, 1000)
24
+ }
24
25
  } catch (ex) {
25
26
  console.error(ex)
26
27
  }
@@ -30,6 +31,12 @@ module.exports = function (RED) {
30
31
  try {
31
32
  let nde = RED.nodes.getNode(evnt.destination.id)
32
33
 
34
+ if (!nde) {
35
+ console.log(`MsgTracer: ignoring event, node '${evnt.destination.id}' not found`)
36
+ console.log(evnt)
37
+ return
38
+ }
39
+
33
40
  // don't publish debug messages for junctions because they
34
41
  // cause errors in handleDebugMessages in the client.
35
42
  if (nde.type == "junction") { return }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gregoriusrippenstein/node-red-contrib-introspection",
3
- "version": "0.15.7",
3
+ "version": "0.15.8",
4
4
  "dependencies": {
5
5
  "got": "^13",
6
6
  "uglify-js": "^3.17.4",