another bugfix #2
This commit is contained in:
parent
2788ad9e38
commit
c155a278e3
@ -50,7 +50,7 @@ module.exports = (lib) => {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
fs.stat('./b/' + cb.file, (err, stat) => {
|
fs.stat('./b/' + cb.file, (err, stat) => {
|
||||||
if(err === null || err.code == 'ENOENT')
|
if(err === null)
|
||||||
fs.unlinkSync('./b/' + cb.file);
|
fs.unlinkSync('./b/' + cb.file);
|
||||||
if(cb.msg !== '')
|
if(cb.msg !== '')
|
||||||
e.reply(cb.msg);
|
e.reply(cb.msg);
|
||||||
@ -179,6 +179,8 @@ module.exports = (lib) => {
|
|||||||
if(size > cfg.maxFileSize)
|
if(size > cfg.maxFileSize)
|
||||||
cb({ success: false, file: tmpdest, msg: 'f0ck! your file is too big (~'+lib.formatSize(size)+'), max '+lib.formatSize(cfg.maxFileSize)+' allowed' });
|
cb({ success: false, file: tmpdest, msg: 'f0ck! your file is too big (~'+lib.formatSize(size)+'), max '+lib.formatSize(cfg.maxFileSize)+' allowed' });
|
||||||
else {
|
else {
|
||||||
|
fs.stat('./b/' + cb.file, (err, stat) => {
|
||||||
|
if(err === null) {
|
||||||
lib.getCheckSum('./b/' + tmpdest, (cbcs) => {
|
lib.getCheckSum('./b/' + tmpdest, (cbcs) => {
|
||||||
lib.checkRepostCheckSum(cbcs, (cbcrcs) => {
|
lib.checkRepostCheckSum(cbcs, (cbcrcs) => {
|
||||||
if(cbcrcs === true) {
|
if(cbcrcs === true) {
|
||||||
@ -193,6 +195,8 @@ module.exports = (lib) => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.on('error', (err) => {
|
.on('error', (err) => {
|
||||||
cb({ success: false, file: tmpdest, msg: err });
|
cb({ success: false, file: tmpdest, msg: err });
|
||||||
|
Loading…
x
Reference in New Issue
Block a user