aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorKevin Grandon <kevingrandon@yahoo.com>2013-01-28 10:46:21 -0800
committerKevin Grandon <kevingrandon@yahoo.com>2013-01-28 10:46:21 -0800
commitee5ae7a9c6ca0ce6136e9b97d4388a1434467b8b (patch)
tree9e455654fbfec694de58cf5477ce4ebaa91100fe /lib
parent75c6e99f3d3ff16cc6f5dc26b7bf1dbbb4b3f648 (diff)
parentcfbc4beca74e7baae5c1cd993e18aa92857291c7 (diff)
downloadjsCalDAV-ee5ae7a9c6ca0ce6136e9b97d4388a1434467b8b.tar.gz
Merge pull request #10 from mozilla-b2g/empty-propstat
Handle empty propstat by sending false
Diffstat (limited to 'lib')
-rw-r--r--lib/caldav/sax/dav_response.js12
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/caldav/sax/dav_response.js b/lib/caldav/sax/dav_response.js
index 69a4368..f168d97 100644
--- a/lib/caldav/sax/dav_response.js
+++ b/lib/caldav/sax/dav_response.js
@@ -165,7 +165,8 @@
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;
@@ -173,14 +174,21 @@
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;
+ }
}
});