Fix undefined ref if we fail to copy/move a upload file

This commit is contained in:
Bryan Ashby 2018-06-23 21:03:32 -06:00
parent ff3ab38a7a
commit 0cfd45d8a9
1 changed files with 1 additions and 1 deletions

View File

@ -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);
}