From abf53e07ce64764f5d95d8666efbeec62383b6a8 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Tue, 15 Sep 2009 08:57:20 +0000 Subject: [PATCH] - Fix sync error with empty WebDAV URL - Fix Verify Server hang with empty WebDAV URL --- chrome/content/zotero/xpcom/storage.js | 10 +++++----- chrome/content/zotero/xpcom/storage/webdav.js | 3 +++ 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/chrome/content/zotero/xpcom/storage.js b/chrome/content/zotero/xpcom/storage.js index 8e38cc6b5..0bc67397b 100644 --- a/chrome/content/zotero/xpcom/storage.js +++ b/chrome/content/zotero/xpcom/storage.js @@ -79,7 +79,9 @@ Zotero.Sync.Storage = new function () { return; } if (!_session.initFromPrefs()) { - _error("Module not initialized"); + Zotero.debug(_session.name + " module not initialized"); + _callbacks.onSkip(); + return; } if (!_session.active) { @@ -639,10 +641,8 @@ Zotero.Sync.Storage = new function () { this.checkServer = function (module, callback) { - _session = new Zotero.Sync.Storage.Session(module, { onError: _error }); - if (!_session.initFromPrefs()) { - _error("Module not initialized"); - } + _session = new Zotero.Sync.Storage.Session(module, { onError: callback }); + _session.initFromPrefs(); _session.checkServer(callback); } diff --git a/chrome/content/zotero/xpcom/storage/webdav.js b/chrome/content/zotero/xpcom/storage/webdav.js index 49b32b9e2..1dfcf6fe9 100644 --- a/chrome/content/zotero/xpcom/storage/webdav.js +++ b/chrome/content/zotero/xpcom/storage/webdav.js @@ -163,6 +163,9 @@ Zotero.Sync.Storage.Session.WebDAV.prototype.initFromPrefs = function () { } var url = Zotero.Prefs.get('sync.storage.url'); + if (!url) { + return false; + } url = scheme + '://' + url; var dir = "zotero";