mirror of
https://iceshrimp.dev/crimekillz/iceshrimp-161sh.git
synced 2024-11-23 12:39:59 +01:00
[API] Fix bug
This commit is contained in:
parent
91ac91ab09
commit
0b1b2a3777
@ -22,6 +22,10 @@ import create from '../../../common/add-file-to-drive';
|
|||||||
module.exports = (file, params, user) =>
|
module.exports = (file, params, user) =>
|
||||||
new Promise(async (res, rej) =>
|
new Promise(async (res, rej) =>
|
||||||
{
|
{
|
||||||
|
if (file == null) {
|
||||||
|
return rej('file is required');
|
||||||
|
}
|
||||||
|
|
||||||
const buffer = fs.readFileSync(file.path);
|
const buffer = fs.readFileSync(file.path);
|
||||||
fs.unlink(file.path, (err) => { if (err) console.log(err) });
|
fs.unlink(file.path, (err) => { if (err) console.log(err) });
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user