From 8cb18b1e484263ff874f5cce881adab89fab355e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Mon, 2 Mar 2015 16:06:40 -0500 Subject: [PATCH] possible fix to group category --- src/groups.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/groups.js b/src/groups.js index ba3ceb41aa..5e91eb0978 100644 --- a/src/groups.js +++ b/src/groups.js @@ -665,7 +665,14 @@ var async = require('async'), } Groups.destroy = function(groupName, callback) { - Groups.get(groupName, {}, function(err, groupObj) { + Groups.getGroupsData([groupName], function(err, groupsData) { + if (err) { + return callback(err); + } + if (!Array.isArray(groupsData) || !groupsData[0]) { + return callback(); + } + var groupObj = groupsData[0]; plugins.fireHook('action:group.destroy', groupObj); async.parallel([