Fix crash when uploading file

This commit is contained in:
Girish Ramakrishnan
2019-12-09 15:02:51 -08:00
parent 9a77fb6306
commit e4dd5d6434
2 changed files with 3 additions and 2 deletions

View File

@@ -2000,7 +2000,8 @@ function uploadFile(appId, sourceFilePath, destFilePath, callback) {
const done = once(function (error) {
safe.fs.unlinkSync(sourceFilePath); // remove file in /tmp
callback(new BoxError(BoxError.FS_ERROR, error.message)); // blame it on filesystem for now
if (error) return callback(new BoxError(BoxError.FS_ERROR, error.message)); // blame it on filesystem for now
callback(null);
});
// the built-in bash printf understands "%q" but not /usr/bin/printf.