Skip to content

Commit

Permalink
Merge pull request #3874 from Unitech/trigger_no_action
Browse files Browse the repository at this point in the history
fix: #3786 fix issue when triggering an action that does not exist
  • Loading branch information
wallet77 authored Aug 21, 2018
2 parents 55b6ccc + 6cbca8b commit e868f00
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/God/ActionMethods.js
Original file line number Diff line number Diff line change
Expand Up @@ -801,6 +801,16 @@ module.exports = function(God) {

var proc_env = God.clusters_db[id].pm2_env;

const isActionAvailable = proc_env.axm_actions.find(action => action.action_name === cmd.msg) !== undefined

// if action doesn't exist for this app
// try with the next one
if (isActionAvailable === false) {
arr.shift();
return ex(arr);
}


if ((p.basename(proc_env.pm_exec_path) == name ||
proc_env.name == name) &&
(proc_env.status == cst.ONLINE_STATUS ||
Expand Down

0 comments on commit e868f00

Please sign in to comment.