Skip to content

Commit 0c749d2

Browse files
committed
Land rapid7#7888, Add exception when SESSION doesn't exist
2 parents 0388c02 + d8511d1 commit 0c749d2

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/msf/core/post_mixin.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ def initialize(info={})
2929
#
3030
# @raise [OptionValidateError] if {#session} returns nil
3131
def setup
32+
unless session
33+
# Always fail if the session doesn't exist.
34+
raise Msf::OptionValidateError.new(['SESSION'])
35+
end
36+
3237
unless session_compatible?(session)
3338
print_warning('SESSION may not be compatible with this module.')
3439
end

0 commit comments

Comments
 (0)