Updates to sentiment, exec and range to handle missing payload properties

This commit is contained in:
dceejay
2015-03-31 08:35:56 +01:00
parent 9c22a770ef
commit 78d1da5fbc
5 changed files with 74 additions and 33 deletions

View File

@@ -66,7 +66,7 @@ module.exports = function(RED) {
}
else {
var cl = node.cmd;
if ((node.addpay === true) && (msg.payload.trim() !== "")) { cl += " "+msg.payload; }
if ((node.addpay === true) && ((msg.payload || "").trim() !== "")) { cl += " "+msg.payload; }
if (node.append.trim() !== "") { cl += " "+node.append; }
if (RED.settings.verbose) { node.log(cl); }
var child = exec(cl, {encoding: 'binary', maxBuffer:10000000}, function (error, stdout, stderr) {