Skip to content

Commit 0546282

Browse files
committed
Land rapid7#3590, rapid7#3574 reversion
2 parents 53b66f3 + 3320a1e commit 0546282

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

lib/msf/core/module/has_actions.rb

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,23 +16,25 @@ def initialize(info={})
1616

1717
def action
1818
sa = datastore['ACTION']
19-
sa ? find_action(sa) : find_action(default_action)
19+
return find_action(default_action) if not sa
20+
return find_action(sa)
2021
end
2122

2223
def find_action(name)
23-
if name
24-
actions.each do |a|
25-
return a if a.name == name
26-
end
24+
return nil if not name
25+
actions.each do |a|
26+
return a if a.name == name
2727
end
28+
return nil
2829
end
2930

3031
#
3132
# Returns a boolean indicating whether this module should be run passively
3233
#
3334
def passive?
34-
act = action
35-
act ? passive_action?(act.name) : self.passive
35+
act = action()
36+
return passive_action?(act.name) if act
37+
return self.passive
3638
end
3739

3840
#

0 commit comments

Comments
 (0)