aboutsummaryrefslogtreecommitdiffstats
path: root/caldav.js
diff options
context:
space:
mode:
authorJames Lal <james@lightsofapollo.com>2013-01-28 10:24:38 -0800
committerJames Lal <james@lightsofapollo.com>2013-01-28 10:46:09 -0800
commitcfbc4beca74e7baae5c1cd993e18aa92857291c7 (patch)
tree9e455654fbfec694de58cf5477ce4ebaa91100fe /caldav.js
parent75c6e99f3d3ff16cc6f5dc26b7bf1dbbb4b3f648 (diff)
downloadjsCalDAV-cfbc4beca74e7baae5c1cd993e18aa92857291c7.tar.gz
Handle empty propstat by sending false
Diffstat (limited to 'caldav.js')
-rw-r--r--caldav.js12
1 files changed, 10 insertions, 2 deletions
diff --git a/caldav.js b/caldav.js
index 7f3d367..fda846e 100644
--- a/caldav.js
+++ b/caldav.js
@@ -2527,7 +2527,8 @@ function write (chunk) {
oncomplete: function() {
var propstat = this.stack[this.stack.length - 1];
- propstat = propstat.propstat;
+ var hash = propstat.propstat;
+
var key;
var status = this.current.status;
var props = this.current.prop;
@@ -2535,14 +2536,21 @@ function write (chunk) {
delete this.current.status;
delete this.current.prop;
+ var hasProps = false;
+
for (key in props) {
+ hasProps = true;
if (Object.hasOwnProperty.call(props, key)) {
- propstat[key] = {
+ hash[key] = {
status: status,
value: props[key]
};
}
}
+
+ if (!hasProps) {
+ propstat.propstat = false;
+ }
}
});