diff options
Diffstat (limited to 'lib/caldav')
-rw-r--r-- | lib/caldav/caldav.js | 6 | ||||
-rw-r--r-- | lib/caldav/request/calendar_home.js | 9 | ||||
-rw-r--r-- | lib/caldav/sax/dav_response.js | 7 |
3 files changed, 14 insertions, 8 deletions
diff --git a/lib/caldav/caldav.js b/lib/caldav/caldav.js index 065b815..ee1b92d 100644 --- a/lib/caldav/caldav.js +++ b/lib/caldav/caldav.js @@ -34,7 +34,11 @@ if (typeof(window) === 'undefined') { return require(require('path').join(__dirname, path)); } else { - return paths[path]; + if (path in paths) { + return paths[path]; + } else { + return null; + } } }, diff --git a/lib/caldav/request/calendar_home.js b/lib/caldav/request/calendar_home.js index f4f80ac..7d4c744 100644 --- a/lib/caldav/request/calendar_home.js +++ b/lib/caldav/request/calendar_home.js @@ -62,7 +62,8 @@ var principal; if (err) { - return callback(err); + callback(err); + return; } principal = findProperty('current-user-principal', data, true); @@ -85,7 +86,8 @@ find.send(function(err, data) { if (err) { - return callback(err); + callback(err); + return; } details = { @@ -107,7 +109,8 @@ self._findPrincipal(self.url, function(err, url) { if (!url) { - return callback(new Error('Cannot resolve principal url')); + callback(new Error('Cannot resolve principal url')); + return; } self._findCalendarHome(url, function(err, details) { diff --git a/lib/caldav/sax/dav_response.js b/lib/caldav/sax/dav_response.js index caba42f..64bf2dd 100644 --- a/lib/caldav/sax/dav_response.js +++ b/lib/caldav/sax/dav_response.js @@ -76,7 +76,7 @@ var match = data.match(HTTP_STATUS); if (match) { - var handler = this.handler; + handler = this.handler; this.current[this.currentTag[handler.tagField]] = match[1]; } else { this._super.ontext.call(this, data, handler); @@ -87,8 +87,6 @@ var PrivilegeSet = Base.create({ name: 'PrivilegeSet', - name: 'href', - onopentag: function(data) { if (this.currentTag.handler === this.handler) { this.stack.push(this.current); @@ -102,7 +100,6 @@ onclosetag: function(data) { var current = this.currentTag; - var data; if (current.handler === this.handler) { data = this.current; @@ -181,6 +178,7 @@ } handler._super.onopentag.call(this, data, handler); + return null; }, oncomplete: function() { @@ -218,6 +216,7 @@ } handler._super.onopentag.call(this, data, handler._super); + return null; }, oncomplete: function() { |