Fix error when DB backup can't be opened
This commit is contained in:
parent
cb5e1fa431
commit
b2b751e0a0
1 changed files with 2 additions and 12 deletions
|
@ -1057,23 +1057,13 @@ Zotero.DBConnection.prototype.backupDatabase = Zotero.Promise.coroutine(function
|
|||
var connection = storageService.openDatabase(Zotero.File.pathToFile(tmpFile));
|
||||
}
|
||||
catch (e) {
|
||||
this._debug("Database file '" + OS.Path.basename(tmpFile) + "' is corrupt -- skipping backup");
|
||||
Zotero.logError(e);
|
||||
this._debug("Database file '" + OS.Path.basename(tmpFile) + "' can't be opened -- skipping backup");
|
||||
if (yield OS.File.exists(tmpFile)) {
|
||||
yield OS.File.remove(tmpFile);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
finally {
|
||||
let resolve;
|
||||
connection.asyncClose({
|
||||
complete: function () {
|
||||
resolve();
|
||||
}
|
||||
});
|
||||
yield new Zotero.Promise(function () {
|
||||
resolve = arguments[0];
|
||||
});
|
||||
}
|
||||
|
||||
// Special backup
|
||||
if (!suffix && numBackups > 1) {
|
||||
|
|
Loading…
Reference in a new issue