1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

fix reference error of msg.status in debug node

This commit is contained in:
Hiroyasu Nishiyama 2022-04-12 11:33:02 +09:00
parent 0aa80d82d9
commit 226f45d8d5

View File

@ -108,7 +108,9 @@ module.exports = function(RED) {
}
})
this.on("input", function(msg, send, done) {
if (hasOwnProperty.call(msg, "status") && hasOwnProperty.call(msg.status, "source") && hasOwnProperty.call(msg.status.source, "id") && (msg.status.source.id === node.id)) {
if (hasOwnProperty.call(msg, "status") && msg.status &&
hasOwnProperty.call(msg.status, "source") && msg.status.source &&
hasOwnProperty.call(msg.status.source, "id") && (msg.status.source.id === node.id)) {
done();
return;
}
@ -129,7 +131,8 @@ module.exports = function(RED) {
fill = "red";
st = msg.error.message;
}
if (hasOwnProperty.call(msg, "status")) {
if (hasOwnProperty.call(msg, "status") &&
msg.status) {
fill = msg.status.fill || "grey";
shape = msg.status.shape || "ring";
st = msg.status.text || "";