From 9471fd8e463c18c0c23506eeec6d5546e3061e46 Mon Sep 17 00:00:00 2001 From: Baris Soner Usakli Date: Sun, 8 Dec 2013 13:04:38 -0500 Subject: [PATCH] closes #635 --- src/upgrade.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/upgrade.js b/src/upgrade.js index 75265c4643..2cf56f985f 100644 --- a/src/upgrade.js +++ b/src/upgrade.js @@ -231,7 +231,15 @@ Upgrade.upgradeRedis = function(callback) { function updateKeyToHash(key, next) { RDB.get(key, function(err, value) { - RDB.hset('global', newKeys[key], value, next); + if(err) { + return next(err); + } + + if(value === null) { + RDB.hset('global', newKeys[key], 0, next); + } else { + RDB.hset('global', newKeys[key], value, next); + } }); }