Skip to content

Commit

Permalink
[fix] Do not break tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
indexzero committed Jul 1, 2015
1 parent 310edd2 commit 1e4953d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
14 changes: 8 additions & 6 deletions lib/forever.js
Original file line number Diff line number Diff line change
Expand Up @@ -758,14 +758,16 @@ forever.findByUid = function (script, processes) {
// Finds the process with the specified pid.
//
forever.findByPid = function (pid, processes) {
var procs = !processes
? null
: processes.filter(function (p) {
return p.pid === pid;
});
pid = typeof pid === 'string'
? parseInt(pid, 10)
: pid;

var procs = processes && processes.filter(function (p) {
return p.pid === pid;
});

if (procs && procs.length === 0) { procs = null; }
return procs;
return procs || null;
};

//
Expand Down
2 changes: 1 addition & 1 deletion test/core/stopbypid-peaceful-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,4 @@ vows.describe('forever/core/stopbypid-peaceful').addBatch({
}
}
}
}).export(module);
}).export(module);

0 comments on commit 1e4953d

Please sign in to comment.