Fix undefined ref if we fail to copy/move a upload file
This commit is contained in:
parent
ff3ab38a7a
commit
0cfd45d8a9
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue