mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Handle webscoket item being parseable but not an object better
and add test
This commit is contained in:
@@ -178,6 +178,9 @@ module.exports = function(RED) {
|
||||
if (this.wholemsg) {
|
||||
try {
|
||||
msg = JSON.parse(data);
|
||||
if (typeof msg !== "object" && !Array.isArray(msg) && (msg !== null)) {
|
||||
msg = { payload:msg };
|
||||
}
|
||||
}
|
||||
catch(err) {
|
||||
msg = { payload:data };
|
||||
|
Reference in New Issue
Block a user