commit 729080db4da0d18cf28758a9020aecd113d00b53
parent f9663dc64dfe5e58c2cab5f0e7150a77a8bdc670
Author: Dan Stillman <dstillman@zotero.org>
Date: Wed, 3 Apr 2013 05:22:33 -0400
Fix "this._deferred is null" WebDAV sync error
This occurred if an attachment had only files beginning with periods.
Diffstat:
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/chrome/content/zotero/xpcom/storage/queue.js b/chrome/content/zotero/xpcom/storage/queue.js
@@ -230,7 +230,12 @@ Zotero.Sync.Storage.Queue.prototype.start = function () {
// The queue manager needs to know what queues were running in the
// current session
Zotero.Sync.Storage.QueueManager.addCurrentQueue(this);
- this.advance();
+
+ var self = this;
+ setTimeout(function () {
+ self.advance();
+ }, 0);
+
return this._deferred.promise;
}
diff --git a/chrome/content/zotero/xpcom/storage/webdav.js b/chrome/content/zotero/xpcom/storage/webdav.js
@@ -957,7 +957,7 @@ Zotero.Sync.Storage.WebDAV = (function () {
obj._uploadFile = function (request) {
var deferred = Q.defer();
- Zotero.Sync.Storage.createUploadFile(
+ var created = Zotero.Sync.Storage.createUploadFile(
request,
function (data) {
deferred.resolve(
@@ -967,6 +967,9 @@ Zotero.Sync.Storage.WebDAV = (function () {
);
}
);
+ if (!created) {
+ return Q(false);
+ }
return deferred.promise;
};