Skip to content

Commit ba7d8ef

Browse files
committed
Land rapid7#3574, has_actions.rb cleanup
2 parents d85b081 + 9694544 commit ba7d8ef

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

lib/msf/core/module/has_actions.rb

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

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

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

3130
#
3231
# Returns a boolean indicating whether this module should be run passively
3332
#
3433
def passive?
35-
act = action()
36-
return passive_action?(act.name) if act
37-
return self.passive
34+
act = action
35+
act ? passive_action?(act.name) : self.passive
3836
end
3937

4038
#

0 commit comments

Comments
 (0)