Land #7888, Add exception when SESSION doesn't exist

bug/bundler_fix
Pearce Barry 2017-01-30 10:29:11 -06:00
commit 0c749d2dcf
No known key found for this signature in database
GPG Key ID: 0916F4DEA5C5DE0A
1 changed files with 5 additions and 0 deletions

View File

@ -29,6 +29,11 @@ module Msf::PostMixin
#
# @raise [OptionValidateError] if {#session} returns nil
def setup
unless session
# Always fail if the session doesn't exist.
raise Msf::OptionValidateError.new(['SESSION'])
end
unless session_compatible?(session)
print_warning('SESSION may not be compatible with this module.')
end