diff --git a/src/groups.js b/src/groups.js index 58170eeaa8..f62fda1f43 100644 --- a/src/groups.js +++ b/src/groups.js @@ -878,8 +878,8 @@ var async = require('async'), }; Groups.search = function(query, options, callback) { - if (!query || !query.length) { - return callback(null, []); + if (!query) { + query = ''; } async.waterfall([ diff --git a/src/socket.io/groups.js b/src/socket.io/groups.js index 902041d6ec..e51c2f6062 100644 --- a/src/socket.io/groups.js +++ b/src/socket.io/groups.js @@ -127,11 +127,11 @@ SocketGroups.delete = function(socket, data, callback) { }; SocketGroups.search = function(socket, data, callback) { - if (!data || !data.query) { + if (!data) { return callback(null, []); } - groups.search(data.query, data.options || {}, callback); + groups.search(data.query || '', data.options || {}, callback); }; SocketGroups.cover = {};