File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -93,15 +93,22 @@ def run_simple(opts = {}, &block)
9393 #
9494 def self . job_run_proc ( ctx )
9595 mod = ctx [ 0 ]
96+ sid = mod . datastore [ "SESSION" ]
9697 begin
9798 mod . setup
9899 mod . framework . events . on_module_run ( mod )
99100 # Grab the session object since we need to fire an event for not
100101 # only the normal module_run event that all module types have to
101102 # report, but a specific event for sessions as well.
102- s = mod . framework . sessions [ mod . datastore [ "SESSION" ] ]
103- mod . framework . events . on_session_module_run ( s , mod )
104- mod . run
103+ s = mod . framework . sessions . get ( sid )
104+ if s
105+ mod . framework . events . on_session_module_run ( s , mod )
106+ mod . run
107+ else
108+ mod . print_error ( "Invalid session ID: #{ sid } " )
109+ mod . cleanup
110+ return
111+ end
105112 rescue ::Timeout ::Error => e
106113 mod . error = e
107114 mod . print_error ( "Post triggered a timeout exception" )
You can’t perform that action at this time.
0 commit comments