From 0cfd45d8a92e991d29853b703e56273ded988abd Mon Sep 17 00:00:00 2001 From: Bryan Ashby Date: Sat, 23 Jun 2018 21:03:32 -0600 Subject: [PATCH] Fix undefined ref if we fail to copy/move a upload file --- core/upload.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/upload.js b/core/upload.js index 87bdcb4a..7dd5dd51 100644 --- a/core/upload.js +++ b/core/upload.js @@ -386,7 +386,7 @@ exports.getModule = class UploadModule extends MenuModule { 'Failed moving physical upload file', { error : err.message, fileName : newEntry.fileName, source : src, dest : dst } ); - if(dst !== finalPath) { + if(!err && dst !== finalPath) { // name changed; ajust before persist newEntry.fileName = paths.basename(finalPath); }