From b522bccf5bafbc5685a778928682acb3771b4a12 Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 28 Mar 2018 10:39:48 +0200 Subject: [PATCH] don't overwrite content with junk --- src/services/sharedFolder.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/services/sharedFolder.js b/src/services/sharedFolder.js index 98b3f5e35c..76637e78b9 100644 --- a/src/services/sharedFolder.js +++ b/src/services/sharedFolder.js @@ -64,6 +64,10 @@ module.exports = { set: function (args, cb) { var path = utils.absolutePath(args.path, this.sharedFolder) if (fs.existsSync(path) && !isRealPath(path, cb)) return + if (args.content === 'undefined') { // no !!!!! + console.log('trying to write "undefined" ! stopping.') + return + } this.trackDownStreamUpdate[path] = path fs.writeFile(path, args.content, 'utf8', (error, data) => { if (error) console.log(error)