From f4b17909fd4219789baf172f4e9f62019de2e153 Mon Sep 17 00:00:00 2001 From: PTR <47147771+PTR-inc@users.noreply.github.com> Date: Mon, 14 Apr 2025 20:04:54 +0200 Subject: [PATCH] add forgotten err object check for fs.unlink (#6972) --- db.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db.js b/db.js index 39309c94..b5a8522b 100644 --- a/db.js +++ b/db.js @@ -3661,7 +3661,7 @@ module.exports.CreateDB = function (parent, func) { let mesg = 'Zipbackup failed (' + obj.backupStatus.toString(2).slice(-8) + '), deleting incomplete backup: ' + obj.newAutoBackupFile; if (func) { func(mesg) } else { parent.addServerWarning(mesg, true ) }; - if (fs.existsSync(obj.newAutoBackupFile)) { fs.unlink(obj.newAutoBackupFile, function (err) { console.error('Failed to clean up backupfile: ' + err.message) }) }; + if (fs.existsSync(obj.newAutoBackupFile)) { fs.unlink(obj.newAutoBackupFile, function (err) { if (err) {console.error('Failed to clean up backupfile: ' + err.message)} }) }; }; if (obj.databaseType != DB_NEDB) { //remove dump archive file, because zipped and otherwise fills up