Skip to content

Commit

Permalink
Merge pull request #990 from niklassletteland/master
Browse files Browse the repository at this point in the history
add id param validation in Job.get() to prevent uncaught exception
  • Loading branch information
behrad authored Jun 2, 2017
2 parents dfeee35 + 8b151b3 commit a54e9dd
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/queue/job.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,9 @@ 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 = '';
Expand Down

0 comments on commit a54e9dd

Please # to comment.