From 26d3eb18c2bf9408f687727d8b1971e9bf58b323 Mon Sep 17 00:00:00 2001 From: Chris Brame Date: Sat, 15 Dec 2018 01:21:42 -0500 Subject: [PATCH] chore(cleanup): code --- src/controllers/api/v1/users.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/controllers/api/v1/users.js b/src/controllers/api/v1/users.js index 0db81bd27..a51dfc753 100644 --- a/src/controllers/api/v1/users.js +++ b/src/controllers/api/v1/users.js @@ -182,6 +182,8 @@ apiUsers.create = function(req, res) { if (_.isUndefined(id)) return done(null); groupSchema.getGroupById(id, function(err, grp) { if (err) return done(err); + if (!grp) return done('Invalid Group (' + id + ') - Group not found. Check Group ID'); + grp.addMember(a._id, function(err, success) { if (err) return done(err);