Skip to content

Commit eab1c04

Browse files
committed
[fix] Check if processes exist before returning in .findByScript(). Fixes #50
1 parent e18a256 commit eab1c04

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/forever.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,9 @@ forever.findByIndex = function (index, processes) {
283283
// Finds the process with the specified script name.
284284
//
285285
forever.findByScript = function (script, processes) {
286-
return processes.filter(function (p) { return p.file === script });
286+
return processes
287+
? processes.filter(function (p) { return p.file === script })
288+
: null;
287289
};
288290

289291
//

0 commit comments

Comments
 (0)