diff --git a/packages/node_modules/@node-red/runtime/lib/storage/localfilesystem/util.js b/packages/node_modules/@node-red/runtime/lib/storage/localfilesystem/util.js index d07d40868..65a3c40e4 100644 --- a/packages/node_modules/@node-red/runtime/lib/storage/localfilesystem/util.js +++ b/packages/node_modules/@node-red/runtime/lib/storage/localfilesystem/util.js @@ -80,7 +80,7 @@ module.exports = { */ writeFile: function(path,content,backupPath) { var backupPromise; - if (backupPath) { + if (backupPath && fs.existsSync(path)) { backupPromise = fs.copy(path,backupPath); } else { backupPromise = Promise.resolve();