diff --git a/lib/warlock.js b/lib/warlock.js index 6e6fb6e..6fb6bdb 100644 --- a/lib/warlock.js +++ b/lib/warlock.js @@ -33,8 +33,7 @@ module.exports = function(redis){ function(err, lockSet) { if (err) return cb(err); - var unlock = warlock.unlock.bind(warlock, key, id); - if (!lockSet) unlock = false; + var unlock = lockSet ? warlock.unlock.bind(warlock, key, id) : false; return cb(err, unlock); }