diff --git a/chrome/content/zotero/xpcom/db.js b/chrome/content/zotero/xpcom/db.js index 2dd50478e..ca007d93c 100644 --- a/chrome/content/zotero/xpcom/db.js +++ b/chrome/content/zotero/xpcom/db.js @@ -40,6 +40,7 @@ Zotero.DBConnection = function(dbName) { Components.utils.import("resource://gre/modules/Sqlite.jsm", this); + this.closed = false; this.skipBackup = false; this.transactionVacuum = false; @@ -913,6 +914,7 @@ Zotero.DBConnection.prototype.checkException = function (e) { Zotero.DBConnection.prototype.closeDatabase = Zotero.Promise.coroutine(function* (permanent) { if (this._connection) { Zotero.debug("Closing database"); + this.closed = true; yield this._connection.close(); this._connection = undefined; this._connection = permanent ? false : null; diff --git a/chrome/content/zotero/xpcom/sync/syncLocal.js b/chrome/content/zotero/xpcom/sync/syncLocal.js index 60db984dc..81a623aa3 100644 --- a/chrome/content/zotero/xpcom/sync/syncLocal.js +++ b/chrome/content/zotero/xpcom/sync/syncLocal.js @@ -670,6 +670,9 @@ Zotero.Sync.Data.Local = { options.onError(e); } + if (Zotero.DB.closed) { + e.fatal = true; + } if (options.stopOnError || e.fatal) { throw e; }