diff --git a/packages/node_modules/@node-red/nodes/core/common/21-debug.js b/packages/node_modules/@node-red/nodes/core/common/21-debug.js index 73d364e43..c67a7d38b 100644 --- a/packages/node_modules/@node-red/nodes/core/common/21-debug.js +++ b/packages/node_modules/@node-red/nodes/core/common/21-debug.js @@ -107,7 +107,7 @@ module.exports = function(RED) { } }) this.on("input", function(msg, send, done) { - if (msg.hasOwnProperty("status") && msg.status.hasOwnProperty("source") && msg.status.source.hasOwnProperty("id") && (msg.status.source.id === node.id)) { + if (Object.prototype.hasOwnProperty.call(msg, "status") && Object.prototype.hasOwnProperty.call(msg.status, "source") && Object.prototype.hasOwnProperty.call(msg.status.source, "id") && (msg.status.source.id === node.id)) { done(); return; } @@ -118,17 +118,17 @@ module.exports = function(RED) { var st = (typeof output === 'string') ? output : util.inspect(output); var fill = "grey"; var shape = "dot"; - if (typeof output === 'object' && output.hasOwnProperty("fill") && output.hasOwnProperty("shape") && output.hasOwnProperty("text")) { + if (typeof output === 'object' && Object.prototype.hasOwnProperty.call(output, "fill") && Object.prototype.hasOwnProperty.call(output, "shape") && Object.prototype.hasOwnProperty.call(output, "text")) { fill = output.fill; shape = output.shape; st = output.text; } if (node.statusType === "auto") { - if (msg.hasOwnProperty("error")) { + if (Object.prototype.hasOwnProperty.call(msg, "error")) { fill = "red"; st = msg.error.message; } - if (msg.hasOwnProperty("status")) { + if (Object.prototype.hasOwnProperty.call(msg, "status")) { fill = msg.status.fill || "grey"; shape = msg.status.shape || "ring"; st = msg.status.text || ""; @@ -194,7 +194,7 @@ module.exports = function(RED) { function sendDebug(msg) { // don't put blank errors in sidebar (but do add to logs) - //if ((msg.msg === "") && (msg.hasOwnProperty("level")) && (msg.level === 20)) { return; } + //if ((msg.msg === "") && (Object.prototype.hasOwnProperty.call(msg, "level")) && (msg.level === 20)) { return; } msg = RED.util.encodeObject(msg,{maxLength:debuglength}); RED.comms.publish("debug",msg); }