This commit is contained in:
Matteo Pagliazzi 2013-11-02 15:54:10 +01:00
parent 9454a3a629
commit 567b69a0f1

View file

@ -64,7 +64,8 @@ api.list = function(req, res) {
Group.findOne({type: 'party', members: {'$in': [user._id]}})
.select(groupFields).exec(function(err, party){
if (err) return cb(err);
cb(null, [party]); // return as an array for consistent ngResource use
cb(null, (party === null ? [] : [party])); // return as an array for consistent ngResource use
});
},