From 729051279468f18ecef1d29115ba5c8e5da52338 Mon Sep 17 00:00:00 2001 From: Dave C-J Date: Mon, 14 Apr 2014 15:49:49 +0100 Subject: [PATCH] Allow File out node to handle objects more usefully. --- nodes/core/storage/50-file.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/nodes/core/storage/50-file.js b/nodes/core/storage/50-file.js index bbd3dcf6a..517823918 100644 --- a/nodes/core/storage/50-file.js +++ b/nodes/core/storage/50-file.js @@ -29,8 +29,10 @@ function FileNode(n) { if (filename == "") { node.warn('No filename specified'); - } else { + } else if (typeof msg.payload != "undefined") { var data = msg.payload; + if (typeof data == "object") { data = JSON.stringify(data); } + if (typeof data == "boolean") { data = data.toString(); } if (this.appendNewline) { data += "\n"; }