Skip to content

Commit

Permalink
[fix] Check if processes exist before returning in .findByScript(). F…
Browse files Browse the repository at this point in the history
…ixes #50
  • Loading branch information
indexzero committed May 13, 2011
1 parent e18a256 commit eab1c04
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/forever.js
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,9 @@ forever.findByIndex = function (index, processes) {
// Finds the process with the specified script name.
//
forever.findByScript = function (script, processes) {
return processes.filter(function (p) { return p.file === script });
return processes
? processes.filter(function (p) { return p.file === script })
: null;
};

//
Expand Down

0 comments on commit eab1c04

Please sign in to comment.