From 749ce5f8e5a9848c9fb462679a689f0da66df431 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Wed, 11 Feb 2015 12:01:46 -0500 Subject: [PATCH] dont crash if callback isnt supplied to list methods --- src/database/redis/list.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/database/redis/list.js b/src/database/redis/list.js index 115a56a767..7ebc068d53 100644 --- a/src/database/redis/list.js +++ b/src/database/redis/list.js @@ -2,34 +2,40 @@ module.exports = function(redisClient, module) { module.listPrepend = function(key, value, callback) { + callback = callback || function() {}; redisClient.lpush(key, value, function(err, res) { callback(err); }); }; module.listAppend = function(key, value, callback) { + callback = callback || function() {}; redisClient.rpush(key, value, function(err, res) { callback(err); }); }; module.listRemoveLast = function(key, callback) { + callback = callback || function() {}; redisClient.rpop(key, callback); }; module.listRemoveAll = function(key, value, callback) { + callback = callback || function() {}; redisClient.lrem(key, 0, value, function(err, res) { callback(err); }); }; module.listTrim = function(key, start, stop, callback) { + callback = callback || function() {}; redisClient.ltrim(key, start, stop, function(err, res) { callback(err); }); }; module.getListRange = function(key, start, stop, callback) { + callback = callback || function() {}; redisClient.lrange(key, start, stop, callback); }; }; \ No newline at end of file