Debug Node failing to report null as part of the node status

If null is sent to a debug node with the node status check box checked an error message occurs, "TypeError: Cannot convert undefined or null to object"

This occurred with a node that has null as an output but can be checked with this flow

[{"id":"384f86827ddc8951","type":"inject","z":"253e042c05439381","name":"Send Null","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"null","payloadType":"json","x":1080,"y":580,"wires":[["938a69049238c1da"]]},{"id":"938a69049238c1da","type":"debug","z":"253e042c05439381","name":"Report Null","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"true","targetType":"full","statusVal":"payload","statusType":"auto","x":1330,"y":580,"wires":[]}]

I am not sure if this is a bug or a restriction on the way that the node status is reported

As you're outputting JSON and null is a valid JSON, I'd say it's a bug.

Code fails at this line here in debug node.

hasOwnProperty.call(output, "fill") is essentially calling hasOwnProperty.call(null, "fill") that fails with above error.

Thanks for pointing us in the right direction - fix PR raised here - fix debug status reporting if null by dceejay · Pull Request #5018 · node-red/node-red · GitHub

3 Likes