Reset bind if msg.payload not an array

should fix #870
This commit is contained in:
Ben Hardill 2022-01-05 10:28:36 +00:00
parent fbe37c4eb9
commit d5cf7c7a9d
No known key found for this signature in database
GPG Key ID: 74DD076979ABB1E7

View File

@ -56,7 +56,7 @@ module.exports = function(RED) {
if (Array.isArray(msg.payload)) {
if (msg.payload.length === (msg.topic.split('$').length - 1) ) { bind = msg.payload; }
else { bind = []; }
}
} else { bind = []; }
node.mydbConfig.db.all(msg.topic, bind, function(err, row) {
if (err) { node.error(err,msg); }
else {