diff --git a/lib/queue/job.js b/lib/queue/job.js index 204aff27..bc2a7624 100644 --- a/lib/queue/job.js +++ b/lib/queue/job.js @@ -159,12 +159,13 @@ exports.rangeByType = function( type, state, from, to, order, fn ) { */ exports.get = function( id, jobType, fn ) { - if (id === null || id === undefined) { - return fn(new Error('invalid id param')); - } if (typeof jobType === 'function' && !fn) { fn = jobType; jobType = ''; + } + + if (id === null || id === undefined) { + return fn(new Error('invalid id param')); } var client = redis.client() , job = new Job;