mirror of
https://github.com/Sebclem/hassio-nextcloud-backup.git
synced 2024-11-22 01:02:59 +01: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));
|
||||
resolve(tmpFile);
|
||||
}).catch((err)=>{
|
||||
if(fs.existsSync(tmpFile))
|
||||
fs.unlinkSync(tmpFile);
|
||||
status.status = "error";
|
||||
status.message = "Fail to download Hassio snapshot (" + err.message + ")";
|
||||
|
Loading…
Reference in New Issue
Block a user