Skip to content

Commit fdbd84d

Browse files
committed
remove data when used in payload
1 parent ae6ef02 commit fdbd84d

2 files changed

Lines changed: 8 additions & 5 deletions

File tree

OpenFlowNodeRED/src/nodered/nodes/rpa_nodes.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,15 @@ export class rpa_detector_node {
4040
}
4141
async OnMessage(msg: any, ack: any) {
4242
try {
43-
// var result: any = {};
44-
// result.amqpacknowledgment = ack;
4543
var msg = JSON.parse(msg.content.toString());
46-
if (msg.data && !msg.payload) msg.payload = msg.data;
44+
if (msg.data && !msg.payload) {
45+
msg.payload = msg.data;
46+
delete msg.data;
47+
}
4748
try {
48-
msg.payload = JSON.parse(msg.payload);
49+
if (typeof msg.payload == "string") {
50+
msg.payload = JSON.parse(msg.payload);
51+
}
4952
} catch (error) {
5053
}
5154
this.node.send(msg);

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.0.515
1+
0.0.516

0 commit comments

Comments
 (0)