diff --git a/src/api/endpoints/drive/files/create.js b/src/api/endpoints/drive/files/create.js index c9de93a9c7..9f34a551d1 100644 --- a/src/api/endpoints/drive/files/create.js +++ b/src/api/endpoints/drive/files/create.js @@ -22,6 +22,10 @@ import create from '../../../common/add-file-to-drive'; module.exports = (file, params, user) => new Promise(async (res, rej) => { + if (file == null) { + return rej('file is required'); + } + const buffer = fs.readFileSync(file.path); fs.unlink(file.path, (err) => { if (err) console.log(err) });