From 3bd6771687c421e70e9ea59296a36ff777e71d41 Mon Sep 17 00:00:00 2001 From: Tyler Renelle Date: Sun, 1 Sep 2013 23:07:50 -0400 Subject: [PATCH] fix "already pending invite" --- src/controllers/groups.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/controllers/groups.js b/src/controllers/groups.js index 1ae67406a5..a6acd26cc1 100644 --- a/src/controllers/groups.js +++ b/src/controllers/groups.js @@ -179,7 +179,7 @@ api.invite = function(req, res, next) { return res.json(400, {err:"User already invited to that group"}); sendInvite(); } else if (group.type == 'party') { - if (invite.invitations && invite.invitations.party) + if (invite.invitations && !_.isEmpty(invite.invitations.party)) return res.json(400,{err:"User already pending invitation."}); Group.find({type:'party', members:{$in:[uuid]}}, function(err, groups){ if (err) return res.json(500,{err:err});