dont do anything if id is falsy

added callback
This commit is contained in:
barisusakli
2015-03-14 16:30:06 -04:00
parent 203e69aa42
commit ec8fc8b97b
2 changed files with 10 additions and 2 deletions

View File

@@ -41,7 +41,10 @@ module.exports = function(db, module) {
module.searchRemove = function(key, id, callback) {
callback = callback || helpers.noop;
db.collection('search').remove({key:key, id:id}, callback);
if (!id) {
return callback();
}
db.collection('search').remove({key: key, id: id}, callback);
};
module.flushdb = function(callback) {