diff --git a/src/groups.js b/src/groups.js index c318db9942..db5974e54e 100644 --- a/src/groups.js +++ b/src/groups.js @@ -182,7 +182,7 @@ var utils = require('../public/src/utils'); results.base.deleted = !!parseInt(results.base.deleted, 10); results.base.hidden = !!parseInt(results.base.hidden, 10); results.base.system = !!parseInt(results.base.system, 10); - results.base.private = results.base.private ? !!parseInt(results.base.private, 10) : true; + results.base.private = (results.base.private === null || results.base.private === undefined) ? true : !!parseInt(results.base.private, 10); results.base.disableJoinRequests = parseInt(results.base.disableJoinRequests, 10) === 1; results.base.isMember = results.isMember; results.base.isPending = results.isPending; @@ -409,7 +409,7 @@ var utils = require('../public/src/utils'); group.createtimeISO = utils.toISOString(group.createtime); group.hidden = parseInt(group.hidden, 10) === 1; group.system = parseInt(group.system, 10) === 1; - group.private = parseInt(group.private, 10) === 1; + group.private = (group.private === null || group.private === undefined) ? true : !!parseInt(group.private, 10); group.disableJoinRequests = parseInt(group.disableJoinRequests) === 1; group['cover:url'] = group['cover:url'] || require('./coverPhoto').getDefaultGroupCover(group.name);