Fix "this._deferred is null" WebDAV sync error

This occurred if an attachment had only files beginning with periods.
This commit is contained in:
Dan Stillman 2013-04-03 05:22:33 -04:00
parent f9663dc64d
commit 729080db4d
2 changed files with 10 additions and 2 deletions

View File

@ -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;
}

View File

@ -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;
};