Don't call sadd with blank args

This commit is contained in:
James Allen 2016-07-07 16:41:38 +01:00
parent 9bd7c0017d
commit 8b090c0a60

View file

@ -143,4 +143,7 @@ module.exports = RedisManager =
getAndSetProject: (project_id, callback = (error) ->) ->
rclient.smembers keys.docsInProject(project_id: project_id), (error, doc_ids) ->
return callback(error) if error?
if doc_ids.length > 0
rclient.sadd keys.docsInProject(project_id: project_id), doc_ids..., callback
else
callback()