This commit is contained in:
Julian Lam
2016-11-23 11:45:29 -05:00
parent 4ff71f6b0b
commit cafbdfd83e
2 changed files with 9 additions and 1 deletions

View File

@@ -16,6 +16,10 @@ module.exports = function (User) {
async.waterfall([
async.apply(db.getSortedSetRevRangeWithScores, 'uid:' + uid + ':bans', 0, 0),
function (record, next) {
if (!record.length) {
return next(new Error('no-ban-info'));
}
timestamp = record[0].score;
expiry = record[0].value;