mirror of
https://github.com/node-red/node-red-nodes.git
synced 2023-10-10 13:36:58 +02:00
Fix snmp node to clone response before sending
This commit is contained in:
parent
aa2965f000
commit
18f42be574
@ -1,9 +1,9 @@
|
|||||||
{
|
{
|
||||||
"name" : "node-red-node-snmp",
|
"name" : "node-red-node-snmp",
|
||||||
"version" : "0.0.21",
|
"version" : "0.0.22",
|
||||||
"description" : "A Node-RED node that looks for SNMP oids.",
|
"description" : "A Node-RED node that looks for SNMP oids.",
|
||||||
"dependencies" : {
|
"dependencies" : {
|
||||||
"net-snmp" : "1.1.8"
|
"net-snmp" : "1.2.4"
|
||||||
},
|
},
|
||||||
"repository" : {
|
"repository" : {
|
||||||
"type":"git",
|
"type":"git",
|
||||||
|
@ -193,7 +193,8 @@ module.exports = function (RED) {
|
|||||||
node.error(error.toString(), msg);
|
node.error(error.toString(), msg);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
msg.payload = response;
|
// Clone the array
|
||||||
|
msg.payload = response.slice(0);
|
||||||
node.send(msg);
|
node.send(msg);
|
||||||
//Clears response
|
//Clears response
|
||||||
response.length = 0;
|
response.length = 0;
|
||||||
@ -243,7 +244,8 @@ module.exports = function (RED) {
|
|||||||
node.error(error.toString(), msg);
|
node.error(error.toString(), msg);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
msg.payload = response;
|
// Clone the array
|
||||||
|
msg.payload = response.slice(0);
|
||||||
node.send(msg);
|
node.send(msg);
|
||||||
//Clears response
|
//Clears response
|
||||||
response.length = 0;
|
response.length = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user