mirror of
https://github.com/Sebclem/hassio-nextcloud-backup.git
synced 2024-08-18 21:54:56 +02:00
🚑 Fix crash on snapshot download fail (form NC) #28
Check if file exist before trying to delete it
This commit is contained in:
parent
097f8d04f5
commit
1237f9c6ff
@ -326,6 +326,7 @@ class WebdavTools {
|
|||||||
logger.debug("Backup dl size : " + (fs.statSync(tmpFile).size / 1024 / 1024));
|
logger.debug("Backup dl size : " + (fs.statSync(tmpFile).size / 1024 / 1024));
|
||||||
resolve(tmpFile);
|
resolve(tmpFile);
|
||||||
}).catch((err)=>{
|
}).catch((err)=>{
|
||||||
|
if(fs.existsSync(tmpFile))
|
||||||
fs.unlinkSync(tmpFile);
|
fs.unlinkSync(tmpFile);
|
||||||
status.status = "error";
|
status.status = "error";
|
||||||
status.message = "Fail to download Hassio snapshot (" + err.message + ")";
|
status.message = "Fail to download Hassio snapshot (" + err.message + ")";
|
||||||
|
Loading…
Reference in New Issue
Block a user